The request in #2865419: Allow wildcard for import force was to force import with wildcards. That issue was closed without actually implementing wildcards for the force import. On line 86 it specifically checks for ~foo.bar and doesn't check for the wildcard possibility of ~foo.*
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | config_ignore-3160360-3.x.patch | 2.76 KB | pookmish |
| #5 | interdiff_1-5.txt | 1.07 KB | ericjenkins |
| #5 | config_ignore-wildcard_force_import-3160360-5.patch | 884 bytes | ericjenkins |
Comments
Comment #2
j_ten_man commentedTested. Works as expected.
This does require that your wildcards come first, but I think that's a fair tradeoff vs performance.
In other words, this does not work:
It has to be in this order:
Comment #3
pookmish commentedBoth orders work in my case. What I'm using this for is to allow subthemes to be enabled and it's ignoring the blocks that are created when turning on a theme.
With that set as the config ignore settings, I'm able to generate any new theme and enable it without any conflicts with config. The theme creates the new config even if it doesn't have any in the config/install directory and they are all prefixed with the theme name. ie "block.block.new_theme_menu" which are then ignore by the rules I'm using.
Perhaps my use case is slightly different which allows the order to be different.
Comment #4
pookmish commentedAhh I take back my previous comment. @j_ten_man was correct. I had to move `block.block.*` to the bottom to get the config import to force my custom theme blocks to be imported.
Comment #5
ericjenkins commentedI was having a nearly-identical desire for a wildcard-for-forced-import feature in the config_export_ignore project and submitted a proposed patch over there.
Inspecting patch #1 has me thinking I should adjust my logic from:
to:
I've also been having the same negated-wildcard ordering issue mentioned in #2, but I think it could be addressed by creating two separate
foreach()loops, and to make up for some of the performance hit we could remove thein_array()check.Attaching patch #5 and interdiff.
Comment #7
grimreaperHi,
I have tested patch from comment 5. Works for me.
Thanks!
Comment #8
nicholasthompsonPatch 5 worked for me too - thank you!
Comment #9
pookmish commentedI took a run at the patch for the 3.x version. I've updated the unit test as well.
Comment #10
pookmish commentedI believe this is outdated now with the 8.x-3.0-rc1 release. I am able to use wildcard force imports without the need for any patch. If anyone can confirm, this issue might be closed.
Comment #11
bircherYes this is fixed now, we also have a test for it.