Closed (fixed)
Project:
Drupal core
Version:
9.3.x-dev
Component:
theme system
Priority:
Critical
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
29 Sep 2021 at 14:16 UTC
Updated:
15 Oct 2021 at 10:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
alexpottComment #3
alexpottHmmm... I wonder what happens if we do this... the use of
==over===is interesting. Here the==matchesFALSE,[],NULLand""Comment #5
alexpottDiscussed this issue with @lauriii. AS a result opened the follow up #3240093: \Drupal\Core\Template\TwigExtension::renderVar() should always return a stringable.
The only reason #3failed is because Umami and Olivero do things like:
to determine whether to render something. Bartik, for example, does:
For my the Umami and Olivero approach of doing
|render|striptags|trimis wrong see #2937640: Umami theme ignores placeholders and HTML replaced elements when checking for empty regions.However the upshot is that we shouldn't really check the behaviour to much here. We have to change it to return an empty string in the
$arg == NULLcase because other wise we have deprecations in PHP 8.1 but the rest of the discussion can happen on the followup.I've added a test so that the current behaviour of the method when it comes to scalars and early returns is unit tested.
Comment #6
andypostAll expectations are covered by test, gtg
++ to keep it in follow-up
Comment #7
catchCommitted 7c88f64 and pushed to 9.3.x. Thanks!