Problem/Motivation
After enabling Require summary
on a Text (formatted, long, with summary) field, when editing the field can't save without giving a default Summary.
Also I can check Require summary without summary input being checked.
Steps to reproduce
- Navigate to
/admin/structure/block/block-content/manage/basic/fields/block_content.basic.body
- Enable
Require summary
(but notSummary input
) - Save (Message:
Saved Body configuration
) - Navigate to
/admin/structure/block/block-content
- Add custom block
- Note: only Block description and Body field are visible, no summary
- Add description
- Add body
- Error:
Summary field is required.
. Note: This behavior is different in Drupal 9.5. There is no longer an error on save. See comment #59. - Back to
/admin/structure/block/block-content/manage/basic/fields/block_content.basic.body
- Note: summary is not visible
- Disable
Require summary
- Error:
Summary field is required.
. Note: This behavior is different in Drupal 9.5. There is no longer an error on save. See comment #59.
Screenshots
Before:
After:
Proposed resolution
Update the form validation to require that Summary input
must be enabled before Require summary
can be enabled.
Also even when Require Summary is checked, builders can still save the field UI without putting a default summary in.
Remaining tasks
Create patchReview patchAnswer outstanding questionsTest patch- Use test-only feature- Commit
Outstanding questions
Outstanding questions (see comments in #38, #53, and #59 for reference).
When editing the text field on an entity:
- When the Summary input is enabled/checked, should the Summary field under Default value automatically display? Or should it only display after the field has been saved? How is this handled in other places? - not sure but also seems like a follow up as this is about fixing a bug (least how I understand it) - Opened #3394040: When the Summary input is enabled/checked, should the Summary field under Default value automatically display
- When the Summary input is disabled/unchecked, what should happen to any existing values in the Summary field? - Seems like a follow up but this issue shouldn't tough that. - Opened #3394041: When the Summary input is disabled/unchecked, what should happen to any existing values in the Summary field?
- When Summary input is disabled/unchecked should Require summary be automatically unchecked? - Yes updating fix
User interface changes
See screenshots
API changes
NA
Data model changes
NA
Release notes snippet
NA