Skip to content
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

Overriding templates from Sylius bundles does not work #9802

Closed
bitbager opened this issue Oct 8, 2018 · 5 comments
Closed

Overriding templates from Sylius bundles does not work #9802

bitbager opened this issue Oct 8, 2018 · 5 comments
Assignees
Labels
Potential Bug Potential bugs or bugfixes, that needs to be reproduced.

Comments

@bitbager
Copy link
Contributor

bitbager commented Oct 8, 2018

Sylius version affected: 1.3.0

Description
Overriding templates from Sylius bundles does not work.

Steps to reproduce
After I create a file under templates/bundles/SyliusShopBundle/Homepage/index.html.twig path and I change the content to blank, I still get the Sylius vendor's homepage index template rendered. The weird thing is that overriding templates from Twig bundle (exceptions) works fine.

Possible Solution
I think this might have something to do with the old templates structure, custom namespaces or theme loader for Sylius bundles.

Tip
If I remove the core template from vendor, then the custom template from templates/bundles/Homepage/index.html.twig is loaded. It seems like the vendor has a higher priority than the app.
Might seem obvious, but the bug was detected on Sylius-Standard and replicated in the PluginSkeleton.

@pamil pamil added the Potential Bug Potential bugs or bugfixes, that needs to be reproduced. label Oct 9, 2018
@pamil
Copy link
Contributor

pamil commented Oct 9, 2018

Related to #9719 and #8929.

@pamil pamil self-assigned this Oct 9, 2018
@bitbager
Copy link
Contributor Author

bitbager commented Oct 9, 2018

Guys, I really need it. Do you have any clue how to fix it? I can provide a PR 😄

@pamil
Copy link
Contributor

pamil commented Oct 9, 2018

I'm on it, it's broken by ThemeBundle logic. If you don't use ThemeBundle, there's a hotfix how to disable it for templates: #7491 (comment)

@bitbager
Copy link
Contributor Author

bitbager commented Oct 9, 2018

Thanks Kamil. I just debugged it quickly and it seems that the $file = $this->templateLocator->locate($template) in ThemeFilesystemLoader (line 120) points to a wrong location. This means that TemplateFileLocator's locate method should be updated. I hope that helps somehow.

@pamil
Copy link
Contributor

pamil commented Oct 11, 2018

#9804 should fix this one.

@pamil pamil closed this as completed Oct 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Potential Bug Potential bugs or bugfixes, that needs to be reproduced.
Projects
None yet
Development

No branches or pull requests

2 participants