From 75890e199a3eeafe94161e89e8d00249376bf5fa Mon Sep 17 00:00:00 2001 From: Marc Kreidler Date: Sun, 29 Mar 2026 22:29:09 +0200 Subject: [PATCH] Revert "Try to fix "Iterate with fetch join in class App\Entity\Parts\PartLot using association part not allowed." when opening BOM" This reverts commit 5c5c7cece179df07d3c5b16562d705e9ff9608fb. --- src/DataTables/ProjectBomEntriesDataTable.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/DataTables/ProjectBomEntriesDataTable.php b/src/DataTables/ProjectBomEntriesDataTable.php index a3e82181..4bf10855 100644 --- a/src/DataTables/ProjectBomEntriesDataTable.php +++ b/src/DataTables/ProjectBomEntriesDataTable.php @@ -185,7 +185,7 @@ class ProjectBomEntriesDataTable implements DataTableTypeInterface ]) ->add('storageLocations', TextColumn::class, [ 'label' => 'part.table.storeLocations', - 'orderField' => 'NATSORT(storageLocationOrder)', + 'orderField' => 'NATSORT(MIN(storageLocations.name))', 'visible' => false, 'render' => function ($value, ProjectBOMEntry $context) { if ($context->getPart() !== null) { @@ -226,7 +226,6 @@ class ProjectBomEntriesDataTable implements DataTableTypeInterface { $builder->select('bom_entry') ->addSelect('part') - ->addSelect('(SELECT MIN(storageLocationSort.name) FROM ' . \App\Entity\Parts\PartLot::class . ' partLotSort LEFT JOIN partLotSort.storage_location storageLocationSort WHERE partLotSort.part = part) AS HIDDEN storageLocationOrder') ->from(ProjectBOMEntry::class, 'bom_entry') ->leftJoin('bom_entry.part', 'part') ->leftJoin('part.category', 'category')