-
Notifications
You must be signed in to change notification settings - Fork 714
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
Including a file with relative path changes the cwd of the including file #246
Comments
Have no one else experienced this? It would be really nice if someone could try my code and confirm whether they get the same error or not. If anything is unclear in my bug description, please let me know so I can clarify. |
I'm working an a fix. |
Great! Thanks! :) |
uwetews
added a commit
that referenced
this issue
Jul 18, 2016
The fix is now in the master branch |
uwetews
added a commit
that referenced
this issue
Jul 18, 2016
Sorry, not completely solved |
uwetews
added a commit
that referenced
this issue
Jul 19, 2016
Now it's done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In some cases with complex inheritance, including one file ruins for other file inclusions, resulting in unsuccessful template compilation. Consider the following example:
This will result in a
Fatal error: Uncaught --> Smarty: Unable to load template file '../Primary.tpl' in 'file:../Container.tpl'
.If you change the order of the buttons in
/Tpl/Collection/Edit.tpl
:You get
Fatal error: Uncaught --> Smarty: Unable to load template file '../General.tpl' in 'file:../Container.tpl'
.So it seems that the first include is always successful, while the second include fails. In other words, both includes are fine, but the first one ruins for the second one. Indeed, if you remove one of the buttons, (either the line
{include '../Primary.tpl' Button=[Name => 'edit', Type => 'submit', Title => _('Save')]}
or the line{include '../General.tpl' Button=[Link => '/admin', Title => _('Cancel')]}
, the template compiles successfully.I suspect that this has to do with the relative paths. After including one of the files, the working directory is changed, so that the second file is not found. A simple test more or less confirms this, as the template compiles successfully when the second include's path is changed from
../Primary.tpl
to./Primary.tpl
.I am using the latest development build 3.1.30-dev of Smarty.
The text was updated successfully, but these errors were encountered: