Problem/Motivation

#3296289: Disable the Summary maxlength options if Summary input is disabled was brought up in the UX channel on the Drupal Slack a few days ago. In case summary input is unchecked for a field the summary related form elements in the maxlength fieldset in the manage form display widget should be hidden. While looking at the maxlength specific issue i've noticed that the widget in manage form display is showing the summary rows and always show the summary field checkbox no matter if the summary input checkbox is checked in the settings of the corresponding field. also the title of the field setting provides no indication if the summary input is checked or not. and it is also possible to hide the summary field and make it required at the same time and the required summary is never shown. I've discussed the issue with @rocketeerbkw at the Drupal Dojo Austin and one day after at #3327488: Drupal Usability Meeting 2022-12-23. The issue will have a link to the recording of the meeting. And for the record the attendees at the usability meeting were @benjifisher and @rkoller (due to the low attendee turn out because of the upcoming holidays it couldn't be considered a full review - we just talked through the points we've noticed)

Steps to reproduce

0. Create a new content type "newcontenttype" at /admin/structure/types/add.
1. Go to admin/structure/types/manage/newcontenttype/fields/node.newcontenttype.body
2. per default summary input is checked and require summary unchecked and the summary is hidden in the default value field set since the edit summary link is visible
3. uncheck summary input now and hit save
4. go to /admin/structure/types/manage/newcontenttype/form-display

=> the summary rows field as well as the always show the summary field are still shown even though it was set otherwise on the field settings.

5. Go back to admin/structure/types/manage/newcontenttype/fields/node.newcontenttype.body
6. leave summary input unchecked and check require summary now and save
7. go to /admin/structure/types/manage/newcontenttype/form-display ( The summary rows and always show the summary field checkbox are also shown
8. go to /node/add/newcontenttype

=> only the body field is shown the required summary is hidden. ( when trying even the ckeditor5 toolbar isnt shown.

9. Go back to admin/structure/types/manage/newcontenttype/fields/node.newcontenttype.body
10. uncheck require summary and check summary input and save
11. Go back into admin/structure/types/manage/newcontenttype/fields/node.newcontenttype.body
12. check summary input and require summary and save.
13. Go back into admin/structure/types/manage/newcontenttype/fields/node.newcontenttype.body

=> summary field becomes persistent without the edit and how option in the default value field set. but if you directly save again without doing anything you are now required to add a default value. that wasn't necessary in step 12.

14. add a default value in the required summary field in the default value fieldset and uncheck summary input and save.

=> that step doesnt make sense since require summary overrides the summary input setting anyway.

Proposed resolution

The easiest fix for the moment would be in case summary input is unchecked in the field settings to:

a) simply hide the summary rows field and the always show the summary field checkbox in the manage form display widget.
b) in case summary input is unchecked to change the title of the widget from Text area with a summary to something like Text area with a deactivated summary (or hidden summary)

it is definitely desirable to hide the form elements in case the corresponding setting is deactivated in the field settings (that was the consensus in between the Dojo in Austin and the Usability Meeting).
During the Dojo in Austin @rocketeerbkw wondered why the summary input and require summary checkboxes are placed in the field setting. If they don't have to be there for a particular reason an option might be to create a second field widget plugin:

manage form display widget with a second field widget plugin

Each field widget plugin would contain the following:

Text area:
Rows-field
Placeholder-field

Text area with a summary:
Rows-field
Placeholder-field
summary rows-field
require summary-checkbox
always show the summary field-checkbox

while on the edit page of a field the summary input and require summary checkboxes could be removed. the only problem i don't have an idea yet and that probably prevents the removal of the two checkboxes is how to adjust the default value field set.
Moving the two checkboxes out of the field settings into one of the field widget plugins would make the configuration clearer and the user wouldn't have to jump between the field setting and the manage form display widget and you would have everything in one place except the default value field set. that would have to remain in the field's settings and is the only downside and flaw for the suggestion having two field widget plugins. and the default value field set is probably also the reason why the summary input and the require summary checkbox are and have to be in the field settings.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#2 plugin.jpg57.55 KBrkoller

Comments

rkoller created an issue. See original summary.

rkoller’s picture

Issue summary: View changes
StatusFileSize
new57.55 KB

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, which currently accepts only minor-version allowed changes. 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.