Skip to content
Snippets Groups Projects
Commit 743e1047 authored by Pawel Ginalski's avatar Pawel Ginalski
Browse files

Issue #3360853 by Londova, gbyte, sidgrafix: Warning: array_flip(): Can only...

Issue #3360853 by Londova, gbyte, sidgrafix: Warning: array_flip(): Can only flip string and integer values, entry skipped in Drupal\Core\Entity\EntityStorageBase->loadMultiple() (line 312 of /core/lib/Drupal/Core/Entity/EntityStorageBase.php
parent 0a6577bf
No related branches found
No related tags found
No related merge requests found
......@@ -213,9 +213,11 @@ class EntityHelper {
$url_object = Url::fromUri('internal:' . $uri);
}
if (!empty($route_parameters = $url_object->getRouteParameters())
&& $this->entityTypeManager->getDefinition($entity_type_id = key($route_parameters), FALSE)) {
return $this->entityTypeManager->getStorage($entity_type_id)->load($route_parameters[$entity_type_id]);
foreach ($url_object->getRouteParameters() as $entity_type_id => $entity_id) {
if ($entity_id && $this->entityTypeManager->hasDefinition($entity_type_id)
&& $entity = $this->entityTypeManager->getStorage($entity_type_id)->load($entity_id)) {
return $entity;
}
}
}
......
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