Skip to content

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

Closed
wants to merge 4 commits into from
Closed

Compatibility with Twig 1.27 #20321

wants to merge 4 commits into from

Conversation

xkobal
Copy link
Contributor

@xkobal xkobal commented Oct 27, 2016

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.

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.
(cherry picked from commit aff42d7)
(cherry picked from commit 1f92096)
@xabbuh
Copy link
Member

xabbuh commented Oct 27, 2016

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
Copy link
Member

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

Copy link
Member

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".

@xkobal
Copy link
Contributor Author

xkobal commented Oct 27, 2016

@xabbuh Done

@xabbuh
Copy link
Member

xabbuh commented Oct 27, 2016

👍 Can we add a test for this too (or did the tests already fail before)?

@xkobal
Copy link
Contributor Author

xkobal commented Oct 27, 2016

@xabbuh I have added a new test

@xkobal
Copy link
Contributor Author

xkobal commented Oct 27, 2016

There were no failing tests, I have found this bug when I have upgraded my project with the Symfony 3.1.6

@fabpot
Copy link
Member

fabpot commented Oct 27, 2016

Thank you @xkobal.

fabpot added a commit that referenced this pull request Oct 27, 2016
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
@fabpot fabpot closed this Oct 27, 2016
@Wirone
Copy link
Contributor

Wirone commented Nov 17, 2016

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?

@xabbuh
Copy link
Member

xabbuh commented Nov 17, 2016

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants