- π«π·France nicolas bouteille
+1 it is very hard to be able to display the description between the label and textarea for formatted text fields when description is removed in TextFormat.php processFormat() $keys_not_to_copy
This new approach seems better - π¬π§United Kingdom steven jones
Issues need to target 11.x. Also, I'm pretty sure 11.x requires merge requests. So creating new patches won't get us anywhere.
- Merge request !7218fix(filter): #2421445: Text format wrapper does not honor description_display β (Open) created by dww
- πΊπΈUnited States dww
Ran into this again on another project. π I agree #19 is better, all it does is remove code! Local testing and it's working fine.
We probably still want tests, so leaving NW and tagged, but I converted #19 into MR !7218 to move this along.
Also, this summary needs the real template and to be filled in.
- πΊπΈUnited States dww
#20 makes sense. I started removing description and related variables from most of these:
% find . -name text-format-wrapper.html.twig ./core/profiles/demo_umami/themes/umami/templates/classy/content-edit/text-format-wrapper.html.twig ./core/modules/filter/templates/text-format-wrapper.html.twig ./core/themes/stable9/templates/content-edit/text-format-wrapper.html.twig ./core/themes/claro/templates/text-format-wrapper.html.twig ./core/themes/starterkit_theme/templates/content-edit/text-format-wrapper.html.twig ./core/themes/olivero/templates/text-format-wrapper.html.twig
I ran into comments with @see pointing to π Fix inconsistencies of TextareaWidget and TextareaWithSummaryWidget form elements Needs work , so adding that as related.
I'm not sure what scope of a fix is appropriate. Currently, the MR only fixes Claro. I know we never touch stable9.
We can fix Olivero, starterkit_theme and demo_umami. But I'm worried about losing functionality if we completely remove all these lines:
- {% if description %} - {% - set description_classes = [ - aria_description ? 'form-item__description', - disabled ? 'is-disabled', - ] - %} - <div{{ description_attributes.addClass(description_classes) }}>{{ description }}</div> - {% endif %}
form-element.html.twig
itself doesn't add a separateis-disabled
class to the description classes, it addsform-item--disabled
to the whole wrapper.- Do we care? Can/should we move this
is-disabled
class ondescription_classes
toform-element.html.twig
? - Can we fix
modules/filter/templates/text-format-wrapper.html.twig
itself? - Should we be removing all mention of
aria_description
from these templates, since we're not using that anymore? - While we're at it, the module template and most of the themes have a comment about
* - attributes: HTML attributes for the containing element.
yet they all do something like this this for the containing element:
<div class="js-text-format-wrapper text-format-wrapper js-form-item form-item">
In practice,
attributes
is only used for the description:{% if description %} <div{{ attributes }}>{{ description }}</div> {% endif %}
That seems like a separate bug. Sound familiar? Needs follow-up?
For now, I pushed separate commits for:
- Olivero
- starterkit_theme
- demo_umami
- modules/filter/templates/text-format-wrapper.html.twig
- Removing
aria_description
from all of them
We can easily revert anything if needed. Curious to see what the bot thinks of all this. Probably some classy test is going to fail about template file hashes changing. π
- Do we care? Can/should we move this
- πΊπΈUnited States dww
Re: #30.4: Reading more closely, that's a big part of what π Fix inconsistencies of TextareaWidget and TextareaWithSummaryWidget form elements Needs work proposes to fix. So that doesn't need another issue. Hopefully this helps reviewers understand why we're leaving the templates alone in this regard. Perhaps we should preserve the @see comments pointing to #3016343?
Meanwhile, gave this a real summary.
- πΊπΈUnited States dww
A few more edits to make the summary more accurate
- πΊπΈUnited States dww
For tests, we could mostly copy
modules/system/tests/src/Kernel/Form/ElementsFieldsetTest.php
intoElementsProcessedTextTest.php
or something (perhaps broaden it to also includetextarea
?). It feels a little gross to copy/pasta, but for now we're still at N=2 and haven't necessarily hit the Rule of 3. At least not that I'm seeing trying to grep the core code. π