Summary

Config Ignore uses the colon (:) as a separator when targeting individual keys to ignore in configuration.

For example, in search_api.index config, you can have configuration that looks like this:

...
datasource_settings:
  'entity:node':
    bundles:
      default: true
      selected:
        - event
        - homepage
    languages:
      default: true
      selected: {  }
...

In my case we want to ignore the languages portion here. So, in my config ignore settings I have the following entry:

search_api.index.global_search:datasource_settings.entity:node.languages.selected

This gets passed into $ignored = explode(':', $ignored) which results in the following split values:

search_api.index.global_search
datasource_settings.entity
node.languages.selected

Suggested Resolution

All instances of explode(':', $ignored) should be corrected to say explode(':', $ignored, 2).

Comments

lpeabody created an issue. See original summary.

lpeabody’s picture

Assigned: lpeabody » Unassigned
Status: Active » Needs review
StatusFileSize
new1.13 KB
lpeabody’s picture

lpeabody’s picture

ckaotik’s picture

Can we be sure that config names never contain a colon? I'd think so, but is there any documentation on it? Probably related to #2845517: Enforce allowed characters of machine names in config entities. in that regard.

This is a very neat patch +1

bircher’s picture

Hmm yes, I think that can work it would be good to have tests for this but if someone else can confirm that this works as expected on a production site that uses that I would be open to accept it without a comprehensive test.

bircher’s picture

Status: Needs review » Fixed

still no test, but oh well..
Thanks for the patch

  • bircher committed 00d3ad1 on 8.x-2.x
    Issue #3067441 by lpeabody: Can't ignore keys that contain colon (:)...

Status: Fixed » Closed (fixed)

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