fix #600: only get distcinct results in search

This commit is contained in:
2019-12-18 17:58:40 +01:00
parent f19d9445a8
commit eb19a2f6b3
@@ -365,6 +365,7 @@ class EdlpSearchController extends ControllerBase {
// dpm($items);
$this->items = [];
$ids = [];
foreach ($items as $item) {
try {
/** @var \Drupal\Core\Entity\EntityInterface $entity */
@@ -376,7 +377,12 @@ class EdlpSearchController extends ControllerBase {
if (!$entity) {
continue;
}
// get distinct results
if(in_array($entity->id(), $ids)){
continue;
}
$ids[] = $entity->id();
// record results
$this->items[] = $entity;
}
// dpm($this->items);