textarea summary field not hidden in Olivero

Created on 11 September 2023, 9 months ago
Updated 12 September 2023, 9 months ago

Problem/Motivation

In Olivero, whether or not "Always show the summary field" is checked for a text_textarea_with_summary field, the summary field is always displayed rather than being available via an "Edit summary" link. In Claro and Stark, this is not the case; an "Edit summary" link or button is displayed correctly.

Steps to reproduce

I created a core Drupal test site on simplytest.me and tested the behavior of the body field in the Article content type with the setting to use the admin theme (Claro) when editing turned on and off. Turning it on - editing in Claro - the summary field behaves correctly. Turning it off - editing in Olivero - the summary field is incorrectly always visible.

Proposed resolution

I did not track down the source problem, other than that the core Text module's textSummary() behavior is expecting to find an item above the summary field with the class "js-text-format-wrapper" and not finding it in Olivero. It's normally set on the DIV around the whole field widget

<div class="js-text-full text-full js-text-format-wrapper js-form-item form-item" data-drupal-selector="edit-body-0">

That class is not set on that DIV in Olivero. I don't know that it's particular to Olivero, maybe Claro and Stark happen to correct a core issue.

🐛 Bug report
Status

Needs work

Version

10.1

Component
Olivero 

Last updated 6 days ago

Created by

🇺🇸United States brad.bulger

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

  • Issue created by @brad.bulger
  • 🇮🇳India Gauravvv Delhi, India

    I think you're trying to use Olivero as admin theme. But we don't recommend using Olivero as an admin theme

  • 🇺🇸United States brad.bulger

    No I'm not.

    Website is the out of the box default on simplytest.me. The standard website theme is Olivero. The admin theme is Claro.

    If you use the website theme to edit content, then you run into this problem.

    That is not "using it as an admin theme", it's editing content.

  • 🇺🇸United States brad.bulger

    And in any case that is irrelevant, it is still a bug somewhere.

  • Status changed to Needs review 9 months ago
  • last update 9 months ago
    29,473 pass
  • 🇷🇺Russia kostyashupenko Omsk

    I would say it's a bug of Olivero theme.
    This functionality (regarding hide/show summary) comes from text.js from core module text

    This script is loaded on the page, but doing nothing with Olivero theme, because it's expecting to have .js-text-format-wrapper selector in DOM and in Olivero this classname doesn't exist. In Claro/stable9/starterkit/umami this classname exist (no matter how exactly this classname is added: by using twig override of text-format-wrapper.html.twig or by hacking preprocess hooks).

    Another strong reason why this is a bug - is that user CAN have access to form display pages.
    This is a quick-fix which i'm sure will be enough (maybe even with missing styles for button html tag for Hide/Show summary text).

    Also screens before patch:

    And after patch:

  • Status changed to Needs work 9 months ago
  • 🇺🇸United States smustgrave

    Seems like something we could add a simple assertion for.

  • 🇺🇸United States brad.bulger

    If it is being left to the themes to add the class, but the core code expects it to be there, is that an issue with the core Text module, or the textarea field widget?

Production build 0.69.0 2024