Problem/Motivation

On my production site, I'm seeing PHP warnings like this:

Warning: Undefined array key "data" in Drupal\custom_field\Plugin\DataType\CustomFieldStringLong->getFormat() (line 72 of /[path]/custom_field/src/Plugin/DataType/CustomFieldStringLong.php)

Warning: Undefined array key "formatted" in Drupal\custom_field\Plugin\DataType\CustomFieldStringLong->getFormat() (line 75 of /[path]/custom_field/src/Plugin/DataType/CustomFieldStringLong.php)

I haven't been able to reproduce the problem on a local environment.

Steps to reproduce

Unknown.

Proposed resolution

Add sanity checks and default values to these array keys.

Remaining tasks

Make a MR.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

benstallings created an issue. See original summary.

benstallings’s picture

Assigned: benstallings » Unassigned
Status: Active » Needs review

apmsooner made their first commit to this issue’s fork.

apmsooner’s picture

Status: Needs review » Fixed

Thanks Ben. It's merged!

apmsooner’s picture

Status: Fixed » Closed (fixed)