- 🇺🇸United States smustgrave
This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request → as a guide.
#14 didn't work for me on Drupal 10.1
Added a test area to a view
Added {{ 'fail'|trans }} to the text area
Would expect to see nothing but renders like I do if I place the same code in a twig template.Also was previously tagged for tests so that will still need to happen as well
- 🇧🇪Belgium Melodia40943
I tried the patch on php 8.1 and drupal 9.5 but it didn't work, the {{"my text"|t }} still appears as is
- 🇺🇸United States SocialNicheGuru
The patch no longer applies to Drupal 9.5.9
- last update
about 1 year ago Custom Commands Failed - last update
about 1 year ago Custom Commands Failed - last update
12 months ago 30,283 pass, 1 fail - 🇺🇸United States el1_1el
Here's a patch for 10.1.3 - yes it has coding style errors (its not going to be committed w/o tests anyway so ¯\_(ツ)_/¯ ).
Patch is designed to show that running $text through Xss::filterAdmin when the $tokens var is empty is what causes the issue. I may be totally mistaken or misunderstanding something, but the $build runs the xss filter anyway at
return Xss::filterAdmin($children);
, so I'm not entirely clear why showing raw twig to users when results are empty is necessary but again ¯\_(ツ)_/¯And moreover - patch is to allow people who have this issue to update to 10.1.x without showing twig syntax to users (ie what my PM/UX manager referred to as "cool gobbly gook")
- last update
7 months ago 29,630 pass, 1 fail - 🇮🇹Italy Giuseppe87
I've tried the patch on D10.1.x but it seems it has some problems:
If I print in the view header using unfiltered text :
{% if 1 > 0 %} hello {% endif %} {{ ""|t}}
Correctly replace the twig.
However,
{% if 1 > 0 %} hello {% endif %}
Does not replace the twig.
What's more, if I use the Global Text Area, and thus a input area with a text format and CKEditor,
{% if 1 > 0 %} hello {{ ""|t}} {% endif %}
is replaced by
{% if 1 > 1 %} hello {% endif %} {{ ""|t}}
Even if writing it in the "source code" mode of CKEditor.
That cause a server error on the error on the view page:
Twig\Error\SyntaxError: Unexpected character "&" in "__string_template__f605a68c7565a3509e2a3d658d6b70a7" at line 1. in Twig\Lexer->lexExpression() (line 376 of /var/www/html/vendor/twig/twig/src/Lexer.php).