Skip to content
Snippets Groups Projects
Verified Commit fecfd281 authored by Lee Rowlands's avatar Lee Rowlands
Browse files

Issue #3163924 by quietone, Berdir: buildEntityView calls resetCache with an...

Issue #3163924 by quietone, Berdir: buildEntityView calls resetCache with an array of ids not entities
parent 4e7ba766
No related branches found
No related tags found
No related merge requests found
......@@ -28,14 +28,12 @@ trait EntityViewTrait {
* @param null $langcode
* (optional) For which language the entity should be prepared, defaults to
* the current content language.
* @param bool $reset
* (optional) Whether to clear the cache for this entity.
*
* @return array
*
* @see \Drupal\Core\Render\RendererInterface::render()
*/
protected function buildEntityView(EntityInterface $entity, $view_mode = 'full', $langcode = NULL, $reset = FALSE) {
protected function buildEntityView(EntityInterface $entity, $view_mode = 'full', $langcode = NULL) {
$ensure_fully_built = function (&$elements) use (&$ensure_fully_built) {
// If the default values for this element have not been loaded yet, populate
// them.
......@@ -60,9 +58,6 @@ protected function buildEntityView(EntityInterface $entity, $view_mode = 'full',
};
$render_controller = $this->container->get('entity_type.manager')->getViewBuilder($entity->getEntityTypeId());
if ($reset) {
$render_controller->resetCache([$entity->id()]);
}
$build = $render_controller->view($entity, $view_mode, $langcode);
$ensure_fully_built($build);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment