[PHP 7.4] Notice: Trying to access array offset on value of type null in linked_field_field_attach_view_alter()

Created on 21 August 2020, over 4 years ago
Updated 27 January 2023, over 2 years ago

Problem/Motivation

PHP 7.4 causes these notices in watchdog:

Notice: Trying to access array offset on value of type null in linked_field_field_attach_view_alter() (line 360 of /var/www/html/docroot/sites/all/modules/contrib/linked_field/linked_field.module).
Notice: Trying to access array offset on value of type null in linked_field_field_attach_view_alter() (line 363 of /var/www/html/docroot/sites/all/modules/contrib/linked_field/linked_field.module).

This is an issue for Display Suite fields, which are handled just a few lines later.

Steps to reproduce

Use PHP 7.4 to serve a site, and view pages with Display Suite fields.

Proposed resolution

A better solution may be move the Display Suite field handling up as part of the if/else chain, however that may be too much change. Proposed patch will just test values before setting.

Remaining tasks

User interface changes

None.

API changes

None.

Data model changes

None.

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States raystuart Indianapolis

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