Skip to content
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

Twig's defined test causes wrap-macro to error #243

Closed
scrummer opened this issue Jan 9, 2025 · 1 comment
Closed

Twig's defined test causes wrap-macro to error #243

scrummer opened this issue Jan 9, 2025 · 1 comment
Assignees
Labels
Milestone

Comments

@scrummer
Copy link
Member

scrummer commented Jan 9, 2025

Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no

In the newer versions of twig, the behaviour of the defined test changed. With the latest version of twig installed, the wrap-macro throws an error:

The "defined" test only works with simple variables. File: /var/www/html/app/vendor/dachcom-digital/toolbox/templates/macro/wrap.html.twig Line: 2

We should change the tests the following:

templates/macro/wrap.html.twig

- {% if attribute(elementTheme, 'wrapper') is defined and elementTheme.wrapper is iterable %}
+ {% if elementTheme.wrapper is defined and elementTheme.wrapper is iterable %}
@scrummer scrummer added the bug label Jan 9, 2025
@scrummer scrummer self-assigned this Jan 9, 2025
@solverat solverat added this to the 5.3.1 milestone Jan 10, 2025
scrummer added a commit that referenced this issue Jan 10, 2025
scrummer added a commit that referenced this issue Jan 10, 2025
scrummer added a commit that referenced this issue Jan 10, 2025
(cherry picked from commit 8c122b3)
@scrummer
Copy link
Member Author

Fixed by #244 in v4.1.3, v5.3.1

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

No branches or pull requests

2 participants