-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
childrenOfPath exclusion now obeys wildcard paths for exceptions. #371
base: develop
Are you sure you want to change the base?
childrenOfPath exclusion now obeys wildcard paths for exceptions. #371
Conversation
When an include predicate uses a childrenOfPath exclude statement, exceptions would not evaluate Unicorn wildcard paths. This has been updated to use a path segment comparison to ensure that any configured unicorn, wildcard paths get correctly identified as an exception. Example CoP configuration: <include name="Data" database="master" path="/sitecore/content/MyTenant/MySite/Data"> <exclude childrenOfPath="*"> <except name="Component Library"></except> </exclude> </include> * Added two new methods to the PathTool class to provide consistency with path comparisons. * Item path escaping rules for Sitecore wildcard items have been "inversed" in the ChildrenOfPathBasedPresetTreeExclusion class for exceptions. This was done since it was possible to define a configuration where path comparisons would previously incorrectly match against Sitecore wildcard items.
Thank you for this :-) However. Looking through what we have, would it not make more sense to hook in this
Currently, this Or am I completely overlooking something while my brain cooks away in "Sunday mode"? :D Ideally, the test config should be expanded to this:
|
While working through the motivation that lead to this PR, I did also "discover" that But the I'll definitely volunteer to add |
Guess we'll both have to muddle through :D But you are exactly right in that there is nothing strange in the idea. I've had lots of requests recently to expand upon these, to allow for more complex including/excluding. I've just had precious little time to give it much consideration the past couple of months. I really appreciate any contributions here. For now, let me see if I can get a test case up and around what you have here. The include/exclude code has quite many execution paths and will send my mind on a spin if I don't have supporting test cases around it. |
When an include predicate uses a
childrenOfPath
exclude statement, exceptions would not evaluate Unicorn wildcard paths. This has been updated to use a path segment comparison to ensure that any configured unicorn, wildcard paths get correctly identified as an exception.Example CoP configuration:
ChildrenOfPathBasedPresetTreeExclusion
class for exceptions. This was done since it was possible to define a configuration where path comparisons would previously incorrectly match against Sitecore wildcard items.