diff --git a/src/Plugin/facets/processor/TranslateEntityProcessor.php b/src/Plugin/facets/processor/TranslateEntityProcessor.php index 40a949e..d408470 100644 --- a/src/Plugin/facets/processor/TranslateEntityProcessor.php +++ b/src/Plugin/facets/processor/TranslateEntityProcessor.php @@ -116,14 +116,14 @@ class TranslateEntityProcessor extends ProcessorPluginBase implements BuildProce ->loadMultiple($ids); // Loop over all results. - foreach ($results as $delta => $result) { - if (!isset($entities[$ids[$delta]])) { - unset($results[$delta]); + foreach ($results as $i => $result) { + if (!isset($entities[$ids[$i]])) { + unset($results[$i]); continue; } /** @var \Drupal\Core\Entity\ContentEntityBase $entity */ - $entity = $entities[$ids[$delta]]; + $entity = $entities[$ids[$i]]; // Check for a translation of the entity and load that instead if one's // found. @@ -132,7 +132,7 @@ class TranslateEntityProcessor extends ProcessorPluginBase implements BuildProce } // Overwrite the result's display value. - $results[$delta]->setDisplayValue($entity->label()); + $results[$i]->setDisplayValue($entity->label()); } // Return the results with the new display values.