|
|
@ -622,10 +622,9 @@ class TwigExtension extends \Twig_Extension { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if ($entity) { |
|
|
|
if ($entity) { |
|
|
|
|
|
|
|
$entity = \Drupal::service('entity.repository')->getTranslationFromContext($entity, $langcode); |
|
|
|
$access = $check_access ? $entity->access('view', NULL, TRUE) : AccessResult::allowed(); |
|
|
|
$access = $check_access ? $entity->access('view', NULL, TRUE) : AccessResult::allowed(); |
|
|
|
if ($access->isAllowed()) { |
|
|
|
if ($access->isAllowed()) { |
|
|
|
$entity = \Drupal::service('entity.repository') |
|
|
|
|
|
|
|
->getTranslationFromContext($entity, $langcode); |
|
|
|
|
|
|
|
if (isset($entity->{$field_name})) { |
|
|
|
if (isset($entity->{$field_name})) { |
|
|
|
$build = $entity->{$field_name}->view($view_mode); |
|
|
|
$build = $entity->{$field_name}->view($view_mode); |
|
|
|
CacheableMetadata::createFromRenderArray($build) |
|
|
|
CacheableMetadata::createFromRenderArray($build) |
|
|
|