Skip to content

Commit d82ba02

Browse files
authored
Merge pull request #3 from iparmentier/iparmentier-patch-1
fix: full page error due to getIdentities function
2 parents d972498 + a747491 commit d82ba02

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

Block/SetList.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -319,18 +319,21 @@ public function getIdentities(): array
319319
{
320320
$identities = [];
321321

322-
$entity = $this->getLayer()->getCurrentAttributeSet();
323-
if ($entity) {
324-
$identities[] = CustomEntity::CACHE_CUSTOM_ENTITY_SET_TAG . '_' . $entity->getAttributeSetId();
322+
$attributeSet = $this->getLayer()->getCurrentAttributeSet();
323+
if ($attributeSet) {
324+
$identities[] = CustomEntity::CACHE_CUSTOM_ENTITY_SET_TAG . '_' . $attributeSet->getAttributeSetId();
325325
}
326326

327327
foreach ($this->_getEntityCollection() as $entity) {
328-
$identities[] = $item->getIdentities();
328+
$entityIdentities = $entity->getIdentities();
329+
if ($entityIdentities) {
330+
foreach ($entityIdentities as $identity) {
331+
$identities[] = $identity;
332+
}
333+
}
329334
}
330335

331-
$identities = array_merge([], ...$identities);
332-
333-
return $identities;
336+
return array_unique($identities);
334337
}
335338

336339
/**
@@ -397,4 +400,4 @@ private function configureToolbar(Toolbar $toolbar, Collection $collection)
397400
$toolbar->setCollection($collection);
398401
$this->setChild('toolbar', $toolbar);
399402
}
400-
}
403+
}

0 commit comments

Comments
 (0)