The Views plugin "Rendered Entity" patch introduced in 8.7.9 removed the check for the entity existence, what is breaking views if the entity don't exist?
This piece of code

if (!$entity = $this->getEntity($values)) {
   return [];
}

in the public function render of Drupal\views\Plugin\views\field\RenderedEntity was replaced by

$entity = $this->getEntityTranslation($this->getEntity($values), $values);

Now if the entity being checked is for example an Anonymous user without language, some views are broken.

Scenario

  1. Fresh install of drupal/social
  2. Enable anonymous users to enroll in events
  3. Create an event and allow anonymous users to enroll
  4. Enroll as anonymous user to that event
  5. As admin, visit the "manage enrollments tab" /node/[nid]/all-enrollments

The view is broken.

Temp resolution
Add the check for entity existence back

if (!$entity = $this->getEntity($values)) {
   return [];
}
CommentFileSizeAuthor
#2 rendered-entities-fix.patch722 bytessibopa

Comments

sibopa created an issue. See original summary.

sibopa’s picture

StatusFileSize
new722 bytes
lendude’s picture

Status: Active » Closed (duplicate)

The line pointed out in the IS and the patch in #2 have been that way since the plugin was introduced in #2632068: Rendered entity views field handler.

So if this broke at some point, it was not due to a change to that specific line...

Were you maybe using a patch from #3007424: Multiple usages of FieldPluginBase::getEntity do not check for NULL, leading to WSOD?

Closing this as a duplicate of #3007424: Multiple usages of FieldPluginBase::getEntity do not check for NULL, leading to WSOD since that changes this check an a great number more to prevent this error from turning up.

sibopa’s picture

Thanks!
I think you are right. I'm using drupal/social which have the #3007424 patch. That's probably what is breaking the view.