TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in in_array() (line 675 of token.module).

Created on 7 March 2024, 4 months ago

Problem/Motivation

When opening the media library on a paragraphs field and adding an image I receive this error which blocks the operation:

TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in in_array() (line 675 of /var/www/html/docroot/modules/contrib/token/token.module).

Additionally our media types support tokens. 

Proposed resolution

I found this similar issue on the CAS issue queue
https://www.drupal.org/project/cas/issues/3318382 β†’

Refactor this line: https://git.drupalcode.org/project/token/-/blob/8.x-1.13/token.module#L675 to:

if (!$triggering_element || empty($triggering_element['#submit']) || !in_array('::save', $triggering_element['#submit'])) {
As refactored in: https://www.drupal.org/project/cas/issues/3318382 β†’

πŸ› Bug report
Status

Closed: duplicate

Version

1.13

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States wstocker

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

Comments & Activities

Production build 0.69.0 2024