diff --git a/core/modules/path/path.module b/core/modules/path/path.module index 979b75f..e433f4d 100644 --- a/core/modules/path/path.module +++ b/core/modules/path/path.module @@ -9,6 +9,7 @@ use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Field\BaseFieldDefinition; use Drupal\Core\Form\FormStateInterface; +use Drupal\Core\Language\LanguageInterface; use Drupal\Core\Routing\RouteMatchInterface; /** @@ -115,9 +116,11 @@ function path_entity_storage_load(array $entities, $entity_type) { foreach ($entities as $entity) { // Get the path for the entity. - $path = \Drupal::service('path.alias_storage')->load([ - 'source' => '/' . $entity->urlInfo()->getInternalPath(), - ]); + $conditions = ['source' => '/' . $entity->urlInfo()->getInternalPath()]; + if ($entity->language()->getId() != LanguageInterface::LANGCODE_NOT_SPECIFIED) { + $conditions['langcode'] = $entity->language()->getId(); + } + $path = \Drupal::service('path.alias_storage')->load($conditions); // If a path was not returned, there is no path. if (!$path) {