-
Notifications
You must be signed in to change notification settings - Fork 56
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
Leading slash in theme paths #328
Comments
It seems that in many cases the path with the leading slash is overridden with the correct path, e.g. if the pattern is provided by a theme. This might be the reason why this was undetected so far. |
I would add tests, but we first need to fix existing tests.. |
It seems there was already a PR that attemps to fix it #327
Your PR will work in both cases where |
Yes we can do that. |
Hi. I've updated the PR with the feedback from #328 (comment):
Knowing that $this->root comes from the app.root service container parameter, it is reasonable to keep the property without the slash, so that it has an expected value for those who extend PatternBase. |
See my comment in #298 (comment).
I defined a pattern in a module using a yml file, and I noticed that the theme hook had a path starting with a leading slash.
E.g.
/modules/custom/my_module/templates/patterns/my_pattern/pattern-my-pattern.html.twig
.The problem seems to be the str_replace() in
PatternBase
andLibraryPattern
, which is meant to remove the absolute part from the pattern path.I am a bit confused why this was not reported as broken before. Am I doing something wrong?
Going to post a minimal PR and we'll see which test blows up.
The text was updated successfully, but these errors were encountered: