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.

Comments

brad.bulger created an issue. See original summary.

gauravvvv’s picture

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

brad.bulger’s picture

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.

brad.bulger’s picture

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

kostyashupenko’s picture

Status: Active » Needs review
StatusFileSize
new451 bytes
new28.3 KB
new30 KB
new24.22 KB

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:
before

And after patch:
After

After

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

Seems like something we could add a simple assertion for.

brad.bulger’s picture

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?

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.