TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in in_array() (line 187 of modules/contrib/config_split_ignore/src/Plugin/ConfigFilter/ConfigSplitIgnoreFilter.php

Created on 15 February 2024, 10 months ago
Updated 23 February 2024, 10 months ago

Problem/Motivation

When you install the module, opening the /admin/config/development/configuration throws the following error:

TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in in_array() (line 187 of modules/contrib/config_split_ignore/src/Plugin/ConfigFilter/ConfigSplitIgnoreFilter.php

Proposed resolution

Providing a patch to fix this issue - it checks if configuration is not empty before trying to search for it.

๐Ÿ› Bug report
Status

Needs review

Version

1.10

Component

Code

Created by

๐Ÿ‡ง๐Ÿ‡ฌBulgaria yivanov

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

Merge Requests

Comments & Activities

  • Issue created by @yivanov
  • ๐Ÿ‡ง๐Ÿ‡ฌBulgaria yivanov
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia chetan 11

    chetan 11 โ†’ made their first commit to this issueโ€™s fork.

  • Merge request !3fixed โ†’ (Open) created by chetan 11
  • Status changed to Needs review 10 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia chetan 11

    Please check the above MR.

  • Status changed to Needs work 10 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States cpierce42

    Merge request #4 fails when running `drush cim -y` patch fails to fix.

    example config file that fails:

    debug: false
    cron_interval: null
    cron_interval_override: null
    hide_signup_messages: 0
    third_party_settings: null

    Error stack:

    $ drush cim -y
     [warning] Undefined array key "ignored" ConfigSplitIgnoreFilter.php:186
     [warning] Undefined array key "ignored" ConfigSplitIgnoreFilter.php:172
     [error]  TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in in_array() (line 172 of /app/docroot/modules/contrib/config_split_ignore/src/Plugin/ConfigFilter/ConfigSplitIgnoreFilter.php) #0 /app/docr
    oot/modules/contrib/config_split_ignore/src/Plugin/ConfigFilter/ConfigSplitIgnoreFilter.php(172): in_array('!acquia_connect...', NULL, true)
    #1 /app/docroot/modules/contrib/config_filter/src/Config/FilteredStorage.php(61): Drupal\config_split_ignore\Plugin\ConfigFilter\ConfigSplitIgnoreFilter->filterExists('acquia_connecto...', true)
    #2 /app/docroot/modules/contrib/config_filter/src/Config/FilteredStorage.php(182): Drupal\config_filter\Config\FilteredStorage->exists('acquia_connecto...')
    
  • First commit to issue fork.
  • Status changed to Needs review 10 months ago
  • ๐Ÿ‡ญ๐Ÿ‡บHungary boobaa

    Update MR helps getting rid of error messages. However, this does not make config_split_ignore working with config_ignore:3.2. ATM, I think the reason is that \Drupal\config_split_ignore\Plugin\ConfigFilter\ConfigSplitIgnoreFilter::create() is not even called with config_ignore:3.2 โ€“ and this might be exactly the same reason that was mentioned in #3413717-6: Error: Class "Drupal\config_ignore\Plugin\ConfigFilter\IgnoreFilter" not found โ†’ .

Production build 0.71.5 2024