-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Compatibility with Twig 1.27 #20321
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
Compatibility with Twig 1.27 #20321
Conversation
For the records, this adds the compatibility with twigphp/Twig#2194. |
@@ -58,6 +58,7 @@ public function exists($name) | |||
* Otherwise the template is located using the locator from the twig library. | |||
* | |||
* @param string|TemplateReferenceInterface $template The template | |||
* @param bool $throw Throw \Twig_Error_Loader exception if template is not found |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please align them:
* @param string|TemplateReferenceInterface $template The template
* @param bool $throw Throw \Twig_Error_Loader exception if template is not found
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And I would change the comment to something like "When true, a \Twig_Error_Loader
exception will be thrown if a template could not be found".
@xabbuh Done |
👍 Can we add a test for this too (or did the tests already fail before)? |
@xabbuh I have added a new test |
There were no failing tests, I have found this bug when I have upgraded my project with the Symfony 3.1.6 |
Thank you @xkobal. |
This PR was submitted for the 3.1 branch but it was merged into the 2.7 branch instead (closes #20321). Discussion ---------- Compatibility with Twig 1.27 | Q | A | ------------- | --- | Branch? | "master" for new features / 2.7, 2.8 or 3.1 for fixes | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | comma-separated list of tickets fixed by the PR, if any | License | MIT | Doc PR | reference to the documentation PR, if any In FilesystemLoader::findTemplate(), you must accept a second argument that when set to "false" returns "false" instead of throwing an exception. Not supporting this argument is deprecated since version 1.27. Commits ------- 77c5395 Compatibility with Twig 1.27
I see that "This PR was submitted for the 3.1 branch but it was merged into the 2.7 branch instead" and then 2.7 -> 2.8 -> 3.1 was merged. @fabpot Will it be released anytime soon for 3.1? |
@Wirone Yes, this fix will be part of the upcoming patch releases for all the maintained Symfony version (i.e. 2.7, 2.8, and 3.1) as well as the new 3.2 release. |
In FilesystemLoader::findTemplate(), you must accept a second argument that when set to "false" returns "false" instead of throwing an exception. Not supporting this argument is deprecated since version 1.27.