Trying to access array offset on value of type null NodeRss.php:26 still present

Created on 29 December 2023, 6 months ago
Updated 18 April 2024, 2 months ago

Problem/Motivation

This is a followup to 🐛 Several warnings while migrating views from D7 to D9 Fixed which is supposed to have fixed a bunch of warnings, including that one, listed in the original issue summary:

Trying to access array offset on value of type null NodeRss.php:26 

The error happens in NodeRss#prepareDisplayOptions. The issues are:

  • the function does not verify that $rowOptions is actually set before accessing it
  • even if it is set, the function does not then verify that the relationship and item_length keys are set on it

Steps to reproduce

  • Create a content view with a RSS display in D7
  • Attempt to migrate it

Proposed resolution

Provide sane default, probably using null-coalescing to [] for the first issue, and building the options key by only adding the relationship and item_length on $display_options['row']['options'] if they are set on the $rowOptions

Remaining tasks

Verify if suggested fix work and implement it, or find a better one.

User interface changes

None.

API changes

None.

Data model changes

None.

🐛 Bug report
Status

Fixed

Version

1.2

Component

Documentation

Created by

🇫🇷France fgm Paris, France

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

Comments & Activities

Production build 0.69.0 2024