Prevent access array offset of type null in EntityReference->query()

Created on 20 June 2022, about 3 years ago
Updated 16 February 2023, over 2 years ago

Problem/Motivation

Created "Entity reference display" in Views module can lead to a notice message because the code tryes to access an array offset that doesnt exists.

Steps to reproduce

- Create a view display of type 'entity reference'.
- Execute it programmatically
- you should see:

Notice: Trying to access array offset on value of type null in Drupal\views\Plugin\views\display\EntityReference->query() (line 195 of core/modules/views/src/Plugin/views/display/EntityReference.php).

Proposed resolution

Apply verification of "empty" before using.

πŸ› Bug report
Status

Needs work

Version

9.5

Component
ViewsΒ  β†’

Last updated about 11 hours ago

Created by

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

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