Warning: Trying to access array offset on value of type null

Created on 19 January 2023, almost 2 years ago
Updated 6 June 2023, over 1 year ago

Problem/Motivation

Access $mapping['field_meta_properties:_formatted']['destination'] in PatternOneForEachFormatter leads to a warning when "formatted" values is not mapped to any region.

  $mapping['field_meta_properties:_formatted']['destination'] !== '_hidden'

This leads to an "Warning: Trying to access array offset on value of type null"
"field_meta_properties:_formatted" seems to be stripped from configuration if it is not mapped. Not sure if this is the right behavior but I guess so to have more clear configuration.

Steps to reproduce

Map a field to pattern and set "_formatted" property to "_hidden" in layout builder.

Proposed resolution

Add a check.

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇩🇪Germany Christian.wiedemann

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