-
-
Notifications
You must be signed in to change notification settings - Fork 159
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
Don't cache absolute paths of templates #5826
Comments
We had a similar issue in |
the cache in Symfony must never contain absolute paths, so that's clearly a bug. |
That does not seem true. Try searching for |
But we indeed dump relative paths when generating the template cache:
@m-vo Can you fix this please? |
I can if it helps in certain setups. But I am not yet convinced this is a bug tbh. The issue only shows if the web process and the CLI resolve absolute paths differently, which sounds like a very strange setup to me, no? |
So I guess it's not worth fixing as any other Twig template wouldn't work either? |
As discussed in the Contao call, twigphp/Twig#3218 needs to be fixed before it makes sense to adjust our code. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Description ----------- Fixes #5826 With #6936 we now could store relative instead of absolute paths in our filesystem loader. But twigphp/Twig#3218 must probably be addressed as well to make an effect. /cc @rabauss Commits ------- 30cbbde store and cache relative instead of absolute paths
Affected version(s)
4.13+
Description
In chrooted environments like on plesk hosting you may have a changing
kernel.project_dir
via cli and web server, e.g. via cli/httpdocs/
and via web server/var/www/vhosts/mydomain.com/httpdocs/
This is especially a problem on
cache:warmup
, since some paths to templates are written absolutely by contao to the cache directory, e.g. for the cache keycontao.twig.template_hierarchy
something like thatAfterwards you can see an error in the back end because via web server the "wrong" absolute path is not resolvable.
One solution would be for contao to write relative paths to the cache folder instead of absolute paths - especially for templates!
see also: https://contao.slack.com/archives/CK4J0KNDB/p1677063729691519
The text was updated successfully, but these errors were encountered: