Problem/Motivation

This is a result of #3268058: Media sources should declare dependency on Provider Bucket
The config data might not contain any dependencies, or might not declare module dependencies. Though it's not good to have empty dependencies, the config event subscriber should check for an array before using `array_search` function. In PHP 8.1 (at least) it produces a fatal error.
The error message is: "TypeError: array_search(): Argument #2 ($haystack) must be of type array, null given in array_search()"

Steps to reproduce

Using php >= 8.1 attempt to set a media type config to have empty dependencies and observe the error.
`drush cset media.type.video dependencies '{}' --input-format=yaml`

Proposed resolution

Check for an array before searching within it.

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

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

pookmish created an issue. See original summary.

pookmish’s picture

Status: Active » Needs review

Chris Burge made their first commit to this issue’s fork.

  • Chris Burge committed 507ec58 on 2.x authored by pookmish
    Issue #3278161 by pookmish, Chris Burge: Check for array in config event...
chris burge’s picture

Status: Needs review » Fixed

@pookmish - Thanks for debugging this bug and opening an MR

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.