Config ignore error after drush cim

Created on 1 December 2019, over 4 years ago
Updated 4 January 2024, 6 months ago
  protected function activeRead($name, $data) {
    $keys = [];
    foreach ($this->configuration['ignored'] as $ignored) {
      // Split the ignore settings so that we can ignore individual keys.
      $ignored = explode(':', $ignored);
      if (fnmatch($ignored[0], $name)) {
        if (count($ignored) == 1) {
          // If one of the definitions does not have keys ignore the
          // whole config.
          return $this->active->read($name);
        }
        else {
          // Add the sub parts to ignore to the keys.
          $keys[] = $ignored[1];
        }
      }

    }

    $active = $this->active->read($name);
    if (!$active) {
      return $data;
    }
    foreach ($keys as $key) {
      $parts = explode('.', $key);

      if (count($parts) == 1) {
        if (isset($active[$key])) {
          $data[$key] = $active[$key];
        }
      }
      else {
        $value = NestedArray::getValue($active, $parts, $key_exists);
        if ($key_exists && $data) {
          // Enforce the value if it existed in the active config.
          NestedArray::setValue($data, $parts, $value, TRUE);
        }
      }
    }
    return $data;
  }

In my case config ignore only works when I add code && $data on line 150 (file: modules\contrib\config_ignore\src\Plugin\ConfigFilter\IgnoreFilter.php)

πŸ› Bug report
Status

Closed: outdated

Version

2.1

Component

Code

Created by

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¨πŸ‡­Switzerland bircher πŸ‡¨πŸ‡Ώ

    This issue is being closed because Config Ignore 2.x is deprecated.

    The new 3,x version has been re-written from the ground up and works in a totally different way, yet it provides the same backwards compatible functionality. All the 2.x tests pass in 3.x and the 3.x codebase is easier to maintain.
    Users of 2.x are strongly encouraged to upgrade to 3.x, as there is a very simple update path.

    So likely this issue is no longer relevant. If you think that this issue still applies please open it again and target the new branch. All issues on the 2.x branch were closed in bulk.

Production build 0.69.0 2024