Skip to content
This repository has been archived by the owner on Feb 6, 2022. It is now read-only.

Twig 2.10 Deprecation Update to swiftmailer.html.twig #282

Merged
merged 1 commit into from May 11, 2019

Conversation

KrisCarr
Copy link
Contributor

@KrisCarr KrisCarr commented May 10, 2019

This change addresses the following Twig deprecation:

Adding an if condition on a for tag is deprecated in Twig 2.10. Use a filter filter or an "if" condition inside the "for" body instead (if your condition depends on a variable updated inside the loop). https://twig.symfony.com/doc/2.x/deprecated.html

This solution uses the "filter" filter to maintain the single-tag "for" previously in place over adding a separate "if" tag. This requires Twig 1.41 or higher. (https://twig.symfony.com/doc/2.x/filters/filter.html)

A solution that does not use "filter" can be found at #284

This change addresses the following Twig deprecation:

Adding an if condition on a for tag is deprecated in Twig 2.10. Use a filter filter or an "if" condition inside the "for" body instead (if your condition depends on a variable updated inside the loop)

This solution uses the "filter" filter to maintain the single-tag "for" previously in place over adding a separate "if" tag.

Reference: https://twig.symfony.com/doc/2.x/deprecated.html
@KrisCarr KrisCarr changed the title Update swiftmailer.html.twig Twig 2.10 Deprecation Update to swiftmailer.html.twig May 10, 2019
KrisCarr added a commit to KrisCarr/swiftmailer-bundle that referenced this pull request May 10, 2019
…ilter

This change addresses the following Twig deprecation:

Adding an if condition on a for tag is deprecated in Twig 2.10. Use a filter filter or an "if" condition inside the "for" body instead (if your condition depends on a variable updated inside the loop). https://twig.symfony.com/doc/2.x/deprecated.html

This solution uses a separate "if" block instead of a "filter" which requires Twig 1.41 or higher. (https://twig.symfony.com/doc/2.x/filters/filter.html)

A solution that does use "filter" can be found at symfony#282
KrisCarr added a commit to KrisCarr/swiftmailer-bundle that referenced this pull request May 10, 2019
This change addresses the following Twig deprecation:

Adding an if condition on a for tag is deprecated in Twig 2.10. Use a filter filter or an "if" condition inside the "for" body instead (if your condition depends on a variable updated inside the loop). https://twig.symfony.com/doc/2.x/deprecated.html

This solution uses a separate "if" block instead of a "filter" which requires Twig 1.41 or higher. (https://twig.symfony.com/doc/2.x/filters/filter.html)

A solution that does use "filter" can be found at symfony#282
@fabpot
Copy link
Member

fabpot commented May 11, 2019

Thank you @KrisCarr.

@fabpot fabpot merged commit ad98ef1 into symfony:master May 11, 2019
fabpot added a commit that referenced this pull request May 11, 2019
…arr)

This PR was merged into the 3.2-dev branch.

Discussion
----------

Twig 2.10 Deprecation Update to swiftmailer.html.twig

This change addresses the following Twig deprecation:

> Adding an if condition on a for tag is deprecated in Twig 2.10. Use a filter filter or an "if" condition inside the "for" body instead (if your condition depends on a variable updated inside the loop). https://twig.symfony.com/doc/2.x/deprecated.html

This solution uses the "filter" filter to maintain the single-tag "for" previously in place over adding a separate "if" tag. This requires Twig 1.41 or higher. (https://twig.symfony.com/doc/2.x/filters/filter.html)

A solution that does not use "filter" can be found at #284

Commits
-------

ad98ef1 Update swiftmailer.html.twig
fabpot added a commit that referenced this pull request Jan 25, 2021
…2.0 (andkovt)

This PR was merged into the main branch.

Discussion
----------

Fixing composer conflict section to allow twig/twig >=1.41,<2.0

Constraint defined in composer.json conflict section prevents from using twig versions from 1.41 up to 2.0. Looking at the reason why this constraint was added

- #282
- 2e5f0d6

it seems that this is an error and twig/twig >=1.41,<2.0 should be supported by this package since twig 1.41+ supports "filter" https://twig.symfony.com/doc/1.x/filters/filter.html

Commits
-------

3491397 Fixing composer conflict section to allow twig/twig >=1.41,<2.0
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants