Open JeanLucEsser opened 4 years ago
Looks like the issue is not because of an unknown filter but because of the arrow function inside it.
This works:
{% set excludeIds = alerts |group('id') %}
But this won't work:
{% set excludeIds = alerts |group(e => e.alertRef[0].id ?? 0) %}
The culprit is that arrow function e => e.alertRef[0].id
.
To be clear, this is not Craft related. Let's take a default twig filter like sort:
{% set alerts = alertsRef|sort((a,b) => a.alertColor <=> b.alertColor) %}
This will return an error.
Upstream Reference: https://github.com/trivago/melody/issues/163
Hi there,
In the same way you added custom twig tags for Craft CMS and others, it would be nice to add custom twig filters (and functions). For example, Craft CMS allows for a few of twig filters in top of twig's defaults as well as some twig functions.
Thanx for everything you bring to the Twig community ;)
[Edit] After some tinkering, this is not the issue. The issue is related to the arrow function (see below).