Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[TwigBundle] made the filesystem loader compatible with Twig 2.0 #8677

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 1 commit into from

Conversation

fabpot
Copy link
Member

@fabpot fabpot commented Aug 6, 2013

Q A
Bug fix? yes (for Twig 2.x)
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets n/a
License MIT
Doc PR n/a

Without adding the exists() method, the code happens to work by chance,
just because the current implementation of Twig exits() method calls
findTemplate().

But we know that it won't be the case anymore as of Twig 2.0.

Without adding the exists() method, the code happens to work by chance,
just because the current implementation of Twig exits() method calls
findTemplate().

But we know that it won't be the case anymore as of Twig 2.0.
@fabpot
Copy link
Member Author

fabpot commented Aug 6, 2013

The unit test does not pass if using Twig 2.0 and without adding the exists() method.

@fabpot
Copy link
Member Author

fabpot commented Aug 6, 2013

This PR addresses the problem mentioned in fabpot/Twig#1156, #8665. It is an alternative for #8667, #8668, and #8672

@hacfi
Copy link
Contributor

hacfi commented Aug 7, 2013

👍 I thought this would be rejected because of duplication of code (try..catch) but it seems to be the only choice here if compatibility with all Twig versions needs to be preserved.

fabpot added a commit that referenced this pull request Aug 8, 2013
This PR was submitted for the master branch but it was merged into the 2.2 branch instead (closes #8677).

Discussion
----------

[TwigBundle] made the filesystem loader compatible with Twig 2.0

| Q             | A
| ------------- | ---
| Bug fix?      | yes (for Twig 2.x)
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Without adding the exists() method, the code happens to work by chance,
just because the current implementation of Twig exits() method calls
findTemplate().

But we know that it won't be the case anymore as of Twig 2.0.

Commits
-------

d00548b [TwigBundle] made the filesystem loader compatible with Twig 2.0
@fabpot fabpot closed this Aug 8, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants