-
Notifications
You must be signed in to change notification settings - Fork 642
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 'filter' filter is broken after update to 3.1.31 #4437
Comments
{% set sizes = [34, 36, 38, 40, 42] %}
<ul>
{% for size in sizes|filter(v => v > 38) %}
<li>{{ size }}</li>
{% endear %}
</ul> |
Thanks for the response @brandonkelly. Sorry, I misquoted the example from Twig's documentation :
Regardless, both this example and the one you provided still return the same TypeError. |
I just copy/pasted that exact same code into a Craft 3.1.31 template and it output |
hmm — I'm on the latest version... Tried |
Search through |
|
Thanks. Still not able to reproduce but I at least made the code where the error is occurring a little more defensive, so hopefully that will fix this for you. Try changing your "require": {
"craftcms/cms": "dev-develop#46499a1f7be531b8867b6953b2e6a6e0fa25e039 as 3.1.31",
"...": "..."
} Then run |
I'm hitting the exact same TypeError as @bryantwells. My environment is PHP 7.3.4 if that has any bearing. I can confirm that 46499a1 fixes the issue. |
This appears to occur because Twig is now wrapping the filtered result in And Craft 3.1.31 is wrapping the filtered result in cms/src/web/twig/Extension.php Lines 588 to 602 in 2c2447c
|
Description
After updating to v3.1.31, twig's 'filter' filter is broken. I'm guessing this might be an issue with twig, but figured I would try here first.
Steps to reproduce
Additional info
The text was updated successfully, but these errors were encountered: