Skip to content
Snippets Groups Projects
Commit 61b29ade authored by Dieter Holvoet's avatar Dieter Holvoet Committed by Lukas Fischer
Browse files

Issue #3359586 by DieterHolvoet: Fatal error when trying to view a kanban of all content

parent 981df7d4
No related branches found
Tags 2.0.4
1 merge request!40Issue #3359586: Fatal error when trying to view a kanban of all content
......@@ -243,7 +243,7 @@ class Kanban {
// Get Entity IDs.
$multipleEntities = [];
if ($entityIds = $this->contentModerationService->getEntityIdsFromContentModerationEntities($this->workflowID, $filters, $this->entityTypes)) {
$multipleEntities = $this->kanbanService->getEntitiesByEntityIds($entityIds, $filters);
$multipleEntities = $this->kanbanService->getEntitiesByEntityIds($entityIds, $filters, $this->entityTypes);
}
$columnEntities = [];
foreach ($multipleEntities as $entities) {
......
......@@ -204,7 +204,7 @@ class KanbanService {
* @return array
* Returns a array with the entities for the given entity ids.
*/
public function getEntitiesByEntityIds(array $entityIds = [], array $filters = []) {
public function getEntitiesByEntityIds(array $entityIds = [], array $filters = [], array $entityTypes = []) {
$result = [];
// Basic table.
......@@ -228,6 +228,11 @@ class KanbanService {
$query[$entityTypeName]->condition('nfd.' . $bundleKey, $filters['content_type']);
}
$bundles = $entityTypes[$entityTypeName] ?? [];
if ($bundles) {
$query[$entityTypeName]->condition('nfd.' . $bundleKey, $bundles, 'IN');
}
// Join with users table to get the username who added the entity.
$query[$entityTypeName]->addField('ufd', 'name', 'username');
$query[$entityTypeName]->addField('nfd', $ownerKey);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment