Closed (fixed)
Project:
Config Distro
Version:
2.0.x-dev
Component:
Code
Priority:
Minor
Category:
Task
Assigned:
Reporter:
Created:
31 May 2020 at 04:34 UTC
Updated:
27 Jun 2023 at 23:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
a.dmitriiev commentedPlease review attached patch.
Comment #3
nedjo@a.dmitriiev
Thanks for the patch!
I don't follow it well enough to understand what it's doing or why. The core commit for #2620576: fnmatch() is not available on all environments (i.e QNAP QTS) was mostly single-line substitutions. Can you explain a bit why we need to do more here?
Comment #4
a.dmitriiev commentedI think my change covers all the possible fnmatch cases, maybe it is overdoing ofcourse. Let's stick to the core approach. I will prepare a new patch.
Comment #5
a.dmitriiev commentedComment #6
a.dmitriiev commentedHere is the new patch attached, following core approach.
Comment #7
joegraduateComment #8
joegraduateComment #9
tadeanThank you for these great patches @a.dmitriiev !
I tested both of these patches out with the
config_distro_ignorefunctionality. In my testing it appears that the patch in #3144145-6: Consider replacing fnmatch usage has an issue where any ignore rule will match any config name (e.g.foowill matchnode.type.my_content_type). The original patch in #3144145-2: Consider replacing fnmatch usage seemed to work in almost all cases but has a minor issue where a partial match now matches a complete config name (e.g.contentmatchesnode.type.my_content_typebecause the generated regex pattern was missing the^$I have updated the patch in #3144145-2: Consider replacing fnmatch usage to fix the substring issue, use
preg_quote, and for coding standards. I have removed the case insensitivity flag becausefnmatch()wasn't originally being used withFNM_CASEFOLD. I think in some cases (windows platforms, maybe?) the original implementation usingfnmatch()might have been case insensitive in some places and not others.Most of the
fnmatch()replacements in Drupal have not been a complete reimplementation of the shell-style patterns as regex, but this patch retains the wildcard functionality on * and ?, which I think is useful for theconfig_distro_ignoreuse case.Comment #10
joegraduatePatch in #9 looks good to me. Thanks @tadean!
Discussed this offline with @tadean and we are in agreement that it would be good to merge this ahead of an alpha release with D10 compatibility and create a follow-up issue that adds automated test coverage for this functionality before creating a beta release.
Comment #11
trackleft2Tested with many patterns using the test module after changing config within the
core.entity_form_display.node.sample_content_type.default.ymlfile including:Comment #13
joegraduateCommitted to 2.0.x. Thanks all!