TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in in_array()

Created on 29 January 2024, 11 months ago

Problem/Motivation

If a triggered element on the node edit form is anything other than "#submit," the above error will occur.

Steps to reproduce

When a paragraph is added inside a node using a paragraph reference field, and inside the manage form display the mode is changed to modal form in the widget settings, the above error occurs.

Proposed resolution

There should be a check for this:

    if (!$triggering_element || !in_array('::save', $triggering_element['#submit'])) {
      return;
    }

to

    if (!$triggering_element || (isset($triggering_element['#submit']) && !in_array('::save', $triggering_element['#submit']))) {
      return;
    }
🐛 Bug report
Status

Closed: duplicate

Version

1.0

Component

Code

Created by

🇮🇳India abhinesh

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

Comments & Activities

Production build 0.71.5 2024