diff --git a/src/Plugin/PanelsStorage/PanelizerFieldPanelsStorage.php b/src/Plugin/PanelsStorage/PanelizerFieldPanelsStorage.php index 5522bad..85f888e 100644 --- a/src/Plugin/PanelsStorage/PanelizerFieldPanelsStorage.php +++ b/src/Plugin/PanelsStorage/PanelizerFieldPanelsStorage.php @@ -12,6 +12,7 @@ use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\Core\Plugin\Context\Context; use Drupal\Core\Plugin\Context\ContextDefinition; use Drupal\Core\Session\AccountInterface; +use Drupal\Core\TypedData\TranslatableInterface; use Drupal\ctools\Context\AutomaticContext; use Drupal\panelizer\Exception\PanelizerException; use Drupal\panelizer\PanelizerInterface; @@ -99,7 +100,9 @@ class PanelizerFieldPanelsStorage extends PanelsStorageBase implements Container $entity = $storage->load($id); } $langcode = $this->languageManager->getCurrentLanguage(LanguageInterface::TYPE_CONTENT)->getId(); - if ($entity->language()->getId() != $langcode) { + if ($entity instanceof TranslatableInterface + && $entity->hasTranslation($langcode) + && $entity->language()->getId() != $langcode) { $entity = $entity->getTranslation($langcode); }