core/lib/Drupal/Core/Entity/Entity/EntityFormDisplay.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/lib/Drupal/Core/Entity/Entity/EntityFormDisplay.php b/core/lib/Drupal/Core/Entity/Entity/EntityFormDisplay.php index 84605dd..abb00d9 100644 --- a/core/lib/Drupal/Core/Entity/Entity/EntityFormDisplay.php +++ b/core/lib/Drupal/Core/Entity/Entity/EntityFormDisplay.php @@ -173,10 +173,11 @@ public function buildForm(FieldableEntityInterface $entity, array &$form, FormSt $field_definition = $this->getFieldDefinition($name); if ($field_definition instanceof FieldConfigInterface) { // @todo: Use RendererInterface::addDependency() once https://www.drupal.org/node/2444231 lands. - $form['name']['#cache']['tags'] = Cache::mergeTags( - $field_definition->getCacheTags(), - $field_definition->getFieldStorageDefinition()->getCacheTags() - ); + $form['name']['#cache']['tags'] = $field_definition->getCacheTags(); + $field_storage_definition = $field_definition->getFieldStorageDefinition(); + if ($field_storage_definition instanceof FieldConfigInterface) { + $form['name']['#cache']['tags'] = Cache::mergeTags($form['name']['#cache']['tags'], $field_storage_definition->getCacheTags()); + } } } }