diff --git a/src/Plugin/Field/FieldFormatter/ColorboxFormatter.php b/src/Plugin/Field/FieldFormatter/ColorboxFormatter.php index 13c410310dc774afd35bf28ce1f75e4cc842bd90..a00e250beb9b0035f0a7b25fb647314c00cc0d17 100644 --- a/src/Plugin/Field/FieldFormatter/ColorboxFormatter.php +++ b/src/Plugin/Field/FieldFormatter/ColorboxFormatter.php @@ -194,7 +194,7 @@ class ColorboxFormatter extends ImageFormatterBase implements ContainerFactoryPl $entity_type = ''; - if (!empty($form['#entity_type'])) { + if (isset($form['#entity_type'] ) && !empty($form['#entity_type'])) { $entity_type = $form['#entity_type']; } @@ -252,7 +252,7 @@ class ColorboxFormatter extends ImageFormatterBase implements ContainerFactoryPl $entity_type = ''; - if (!empty($form['#entity_type'])) { + if (isset($form['#entity_type']) && !empty($form['#entity_type'])) { $entity_type = $form['#entity_type']; }