Commit 1a3207d1 authored by Sascha Grossenbacher's avatar Sascha Grossenbacher Committed by Sascha Grossenbacher
Browse files

Issue #3123876 by oksana-c, Berdir: Entity display plugin "Rendered Entity"...

Issue #3123876 by oksana-c, Berdir: Entity display plugin "Rendered Entity" should only add cache key if the entity is render cached
parent 1a225097
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -76,7 +76,12 @@ class RenderedEntity extends FieldWidgetDisplayBase implements ContainerFactoryP
      ->view($entity, $this->configuration['view_mode']);

    $build['#entity_browser_suppress_contextual'] = TRUE;

    // If the entity is render cached, add another cache key to differentiate
    // it from other places using the same view mode.
    if (!empty($build['#cache']['keys'])) {
      $build['#cache']['keys'][] = 'entity_browser';
    }

    return $build;
  }