Multiple usages of FieldPluginBase::getEntity do not check for NULL, leading to WSOD

Created on 17 October 2018, about 6 years ago
Updated 2 February 2023, almost 2 years ago

Problem/Motivation

Like the already committed #2913971: Views regression: 8.4.x EntityField can't handle a null row value from a non-required relationship , there are multiple places where the return value of \Drupal\views\Plugin\views\field\FieldPluginBase::getEntity is not checked for NULL values, leading to WSOD. Setting major thus.

Proposed resolution

Fix all these like in the linked issue. A muscling-through of the 25 occurences i could find is in attached patch.

Remaining tasks

Decide what tests we need and add them.

User interface changes

None.

API changes

Some internal methods' signatures changed from foo to foo|null. Given that the unexpected value null only occurs when until now we got a WSOD, this will not make anything worse for anyone.
* \Drupal\views\Entity\Render\EntityTranslationRenderTrait::getEntityTranslation
* \Drupal\views\Plugin\views\field\LinkBase::getUrlInfo

Data model changes

None.

🐛 Bug report
Status

Needs work

Version

10.1

Component
Views 

Last updated about 2 hours ago

Created by

🇩🇪Germany geek-merlin Freiburg, Germany

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024