Closed (fixed)
Project:
Config Ignore
Version:
8.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
9 Dec 2019 at 09:15 UTC
Updated:
17 Mar 2020 at 15:39 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
bartlangelaanThis is the patch that gives an idea how this could be implemented. As stated in the issue summary, it's just a proof of concept and is not according to standards yet.
Comment #3
jkswoods commentedHave tested this and it works fine with 8.8. On a related note, I'd have to agree with a 3.x branch for these changes, dropping the dependency on config_filter is a good move and makes the module easier to maintain.
Comment #4
jeroentComment #5
jkswoods commentedfnmatchhas been used within the patch which is not available on non-POSIX compliant systems according to php.net https://www.php.net/manual/en/function.fnmatch.phpComment #6
jeroentAbout
fnmatch. This is also used in the current version of the module and is already being discussed in #3042661-7: Drupal 9 Deprecated Code Report.Comment #7
jkswoods commentedOkay cool, based on the discussion in that issue fnmatch is a not a priority for now.
Comment #8
claudiu.cristeaWe shouldn't change existing update hooks. Projects may uninstall
config_filterif they consider that it's not used by any other functionality.Needs {@inheritdoc} block.
Should have code block delimiters
{...}.Should start with a verb. E.g. "Acts on config import/export transform."
The services should be injected.
Remove the empty line. Format the comments to fit 80 chars.
Missed doc block.
Comment #9
claudiu.cristeafnmatch().Comment #10
rajab natshah+1
Comment #11
jkswoods commentedRe #9: Have tested locally and can confirm this is working fine.
Comment #12
ayalon commentedI tested it a lot and finally figured out that you need Drush 10. It does not work on Drush 9.7.1 at all because the new service is not used and therefore the hooks are not called. Not very obvious.
Comment #13
jkswoods commented@ayalon the README.txt has been updated in the patch to mention requiring Drush 10.
Comment #14
jeroentPatch #9 does not work in combination with configuration translation.
e.g. Create a webform and translate it in multiple languages. As ignored config I used 'webform.webform.*'.
When runnning `drush cim`the translated config is removed.
Comment #15
claudiu.cristea#14 needs regression test.
Comment #16
kim.pepperAny examples of a test that uses config translation?
Comment #17
kim.pepperI thought I'd start working on this with a KernelTest, but ran into issues with a simple copy of the BrowserTest. There must be something I don't get about how to do kernel tests of config import etc.
Comment #19
ayalon commentedThe bug decribed in #14 makes this patch very dangerous for multilingual site because of potential loss of all new translations. So be careful using this patch until the bug is fixed.
Comment #20
ayalon commentedI'm not an expert of the "Configuration Management Interface" of Drupal.
But here is my proposal, how to fix the issue with the translations (collections) of ignored configurations.
The patch is based on #9.
Please give some feedback, if you think this is a possible solution.
Comment #21
kim.pepperComment #22
kim.pepper@ayalon Looks like your patch has some issues. Did you follow the steps outlined in https://www.drupal.org/node/1054616 ?
Comment #23
ayalon commentedI can apply the patch using composer patches. Not sure why you have issues.
Comment #24
claudiu.cristea@ayalon, I cannot apply it either:
Comment #25
mikran commentedI managed to apply the patch by adding a newline to the end of the patch file.
Here is the patch with just the newline added.
Comment #26
mikran commented#20 did not include the changes made in #17, so here is a new rerolled patch with those changes included, and an interdiff.
Comment #27
kim.pepperThis builds on top of #26 fixing a couple of tests an code style.
Comment #29
claudiu.cristeaHere's a test that checks the export/import but, this time, is using Drush. Unfortunately I couldn't follow the changes since #9, so this patch is built against #9. The test proves that both, import & export are buggy.
Comment #30
claudiu.cristeaHm, the first test should not fail in that line. Look like there's an issue with the file permissions?
Comment #31
claudiu.cristeaRemoving the debug line.
Comment #32
claudiu.cristeaHere's the fix. Note that the main test fails on composer as this needs Drupal >=8.8.x, so check only the right test. Normally, this patch, if it's approved will be against a new 8.x-3.x branch.
Comment #33
claudiu.cristeaFixed coding standards, improved docs, removed code duplication from unit test.
Comment #34
claudiu.cristeaOther small docs improvements.
Comment #35
claudiu.cristeaTry to support also PHP 7.0
Comment #36
claudiu.cristealist() shorthand not supported in 7.0
Comment #38
claudiu.cristeaAs long as this new branch will require Drush 10, which requires PHP >=7.1, we will not support 7.0.
Also the
config_ignore_deactivatekill-switch should not act when building the listeners list but on each listener. The reason is that the listeners list is rebuild only on container rebuild. Someone might add the kill-switch in settings.php without rebuilding the container (clearing the cache) and, as an effect, the kill-switch will not work.Comment #39
kim.pepperThanks for pushing this forward @claudiu.cristea. Looks like you have addressed the issue in #14.
Comment #40
bircherThis looks very good.
I am going to commit this with the difference that we require
^8.8.I have some concerns with the following: The expansion of the ignored wildcard keys is done against the active config for both import and export.
Also I inverted the for loops for the collections and ignore names, so that creacteCollection is in only one loop.
Comment #41
bircherComment #42
claudiu.cristeaComment #44
bircherSorry, for some reason I had the wrong patch, fixed now. I guess I should have double checked again after my laptop froze.
Comment #45
ayalon commentedThanks a lot for the fast adoption and all the worktime went into this.
Comment #46
claudiu.cristea@ayalon, it was discovered that the current 3.x branch has some bugs. I've provided a fix in #3117135: TypeError: Argument 1 passed to NestedArray::unsetValue() must be of the type array, null given. Could you test 3.x with that patch applied?