From e75e0c4c0b70696f48d969e96e641bad0be302e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Thu, 27 Mar 2025 20:34:32 +0100 Subject: [PATCH] Add a link to the category part info as category description in KiCAD. This also fixes issue #878 --- src/Services/EDA/KiCadHelper.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Services/EDA/KiCadHelper.php b/src/Services/EDA/KiCadHelper.php index 13de01e8..c0144585 100644 --- a/src/Services/EDA/KiCadHelper.php +++ b/src/Services/EDA/KiCadHelper.php @@ -27,6 +27,7 @@ use App\Entity\Parts\Category; use App\Entity\Parts\Footprint; use App\Entity\Parts\Part; use App\Services\Cache\ElementCacheTagGenerator; +use App\Services\EntityURLGenerator; use App\Services\Trees\NodesListBuilder; use Doctrine\ORM\EntityManagerInterface; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; @@ -44,6 +45,7 @@ class KiCadHelper private readonly EntityManagerInterface $em, private readonly ElementCacheTagGenerator $tagGenerator, private readonly UrlGeneratorInterface $urlGenerator, + private readonly EntityURLGenerator $entityURLGenerator, private readonly TranslatorInterface $translator, /** The maximum level of the shown categories. 0 Means only the top level categories are shown. -1 means only a single one containing */ private readonly int $category_depth, @@ -108,6 +110,8 @@ class KiCadHelper $result[] = [ 'id' => (string)$category->getId(), 'name' => $category->getFullPath('/'), + //Show the category link as the category description, this also fixes an segfault in KiCad see issue #878 + 'description' => $this->entityURLGenerator->listPartsURL($category), ]; }