Bug: Twig cache warmer does not respect twig files on (second) project level
Hello everyone!
I have a problem with the console command to warm up the Twig caches.
Console twig:cache:warmer
This command doesn't seem to respect our project structure as it should.
structure
- src
- <OurProjectNamespace>
- …
- Yves
- …
- Pyz
- …
- Yves
- …
- <OurProjectNamespace>
Every time we use the command "console twig:cache:warmer", a file “src/Generated/Yves/Twig/codeBucket/.pathCache” is created. This is fine. But it does not resolve the correct template paths for <OurProject>. Instead, it uses the path to the templates that are located under Pyz.
Fun fact 1: If I create a new “project folder” named “Zzz”, it works as expected. So I suspect the twig:cache:warmer is simply working in alphabetical order instead of using the configured project namespaces.
Fun fact 2: If I load the frontend with running the cache warmer before, the path is also resolved correctly because \Spryker\Shared\Twig\TwigFilesystemLoader is used here, which works with configured project namespaces.
Is this a know bug? Or did we misconfigure something else?
Best
David
Comments
-
You can try extending this class
to redefine the paths.0 -
Hey! Yes, I could, but that won't help because during
console twig:cache:warmer only the methods “getDefaultPathCache”, “getYvesThemeName” and “getYvesThemeNameDefault” are used. This is what I tried to describe, the console command does not respect the project namespaces (and also the core namespaces). Instead, it simply goes through the src folder alphabetically and collects the Twig files.0 -
Hey @DavidGreiner did u write a workaround for it? If yes, can u please share your solution? Thanks in advance
0 -
Hey @ynnoig ! No i did not write any workaround or bugfix. I thought it could be planned internally on spryker side to analyze and fix this :) :)
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 76 Spryker News
- 929 Developer Corner
- 787 Spryker Development
- 89 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 35 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 26 Job Opportunities
- 3.2K 📜 Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 70 Spryker Safari Questions
- 50 Random