diff --git a/src/Controller/AdminController.php b/src/Controller/AdminController.php index 5f6a393..1e73883 100644 --- a/src/Controller/AdminController.php +++ b/src/Controller/AdminController.php @@ -141,9 +141,12 @@ public function gridProxyAction(Request $request, Service $service, EventDispatc $list->setObjectTypes(['object', 'folder', 'variant']); $conditionFilters = []; - $idField = DataObjectService::getVersionDependentDatabaseColumnName('id'); - $keyColumn = DataObjectService::getVersionDependentDatabaseColumnName('key'); - $pathColumn = DataObjectService::getVersionDependentDatabaseColumnName('path'); + + // this is necessary to properly reference the columns from main query in the workspaces related sub-query + $listingTableName = $list->getDao()->getTableName(); + $idField = $listingTableName . '.' . DataObjectService::getVersionDependentDatabaseColumnName('id'); + $keyColumn = $listingTableName . '.' . DataObjectService::getVersionDependentDatabaseColumnName('key'); + $pathColumn = $listingTableName . '.' . DataObjectService::getVersionDependentDatabaseColumnName('path'); if (!$this->getPimcoreUser()->isAdmin()) { $userIds = $this->getPimcoreUser()->getRoles(); $userIds[] = $this->getPimcoreUser()->getId(); @@ -157,11 +160,9 @@ public function gridProxyAction(Request $request, Service $service, EventDispatc if (!empty($ids)) { $conditionFilters[] = $idField . ' IN (' . implode(',', $ids) . ')'; - //$list->setCondition($idField . " IN (" . implode(",", $ids) . ")"); $list->setOrderKey(' FIELD(' . $idField . ', ' . implode(',', $ids) . ')', false); } else { $conditionFilters[] = '1=2'; - //$list->setCondition("1=2"); } $list->setCondition(implode(' AND ', $conditionFilters));