Problem/Motivation
Upgrading from 2.0 to 2.1 causes the Summary field to be required unconditionally.
Steps to reproduce
Drupal 10.3
Upgrade to 2.1
Edit a piece of content with a text with summary field
Click the "Edit Summary" link
Summary is expanded and is required, regardless of the field's summary required settings
This is caused by the condition having been removed in text_summary_options.module
Not sure why it was decided to unconditionally mark the field as required, but doesn't seem to make sense
The original code was conditional on Drupal version 8.8, so maybe I'm missing something in the thread
Proposed resolution
Add back the condition, if ($required_summary_setting) before doing $element['summary']['#required'] = TRUE;
Remaining tasks
Check the required status instead of setting it to TRUE unconditionally. Again, not sure if the Drupal version affects how this is checked.
Issue fork text_summary_options-3467688
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
darkodev commentedComment #3
darkodev commentedComment #6
kim.pepperI didn't remove enough of the logic that was < 8.8
Comment #7
kim.pepperI added a test to confirm the expected behavior. Unfortunately the test-only job failed to run due to the addition of composer.json. @darkodev perhaps you can confirm this works for you in your setup?
Comment #8
darkodev commentedRTBC +1.
The module now respects the "Require summary" field setting.
Thanks for fixing that!
Comment #10
kim.pepperCommitted to 2.x. Thanks!