Commit 344c6cc1 authored by Sander Vleugels's avatar Sander Vleugels Committed by Italo Mairo
Browse files

Issue #2950829 by alduya, itamair: Load translated entity in map field formatter

parent cdf122af
Loading
Loading
Loading
Loading
+5
Changes for src/Plugin/Field/FieldFormatter/GeofieldGoogleMapFormatter.php: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -510,6 +510,11 @@ class GeofieldGoogleMapFormatter extends FormatterBase implements ContainerFacto

    /* @var \Drupal\Core\Entity\EntityInterface $entity */
    $entity = $items->getEntity();
    // Take the entity translation, if existing.
    /* @var \Drupal\Core\TypedData\TranslatableInterface $entity */
    if ($entity->hasTranslation($langcode)) {
      $entity = $entity->getTranslation($langcode);
    }
    $entity_type = $entity->getEntityTypeId();
    $bundle = $entity->bundle();
    $entity_id = $entity->id();