Problem/Motivation
Drupal 10.1.0 introduced a validation message "Comments field is required" when creating a content item for a content type that has comments set to hidden.
Steps to reproduce
Configure comment field on type Article to be "Hidden". Create an article, fill in title only and try to save.
Proposed resolution
I traced this back to #3347296: Conditionally show default value fields, which changed the comment settings field to a required field, regardless of the form being rendered on the administration page or the content creation page.
Somehow conditionally setting required to TRUE could bring back the old behaviour, I guess.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 3373867-4.patch | 2.78 KB | lauriii |
| #4 | 3373867-4-test-only.patch | 1.51 KB | lauriii |
| #3 | 3373867-3.patch | 1.28 KB | lauriii |
Comments
Comment #2
eric_a commentedThe issue that accidentally broke the node form was filed in the "field_ui.module" component, but I guess the bug it introduced should be in comment.module.
Comment #3
lauriiiProbably still need to write some tests for this. I couldn't find existing test coverage for this 😬
Comment #4
lauriiiAnd here's some additional test coverage for this. The test only patch is also the interdiff.
Comment #5
lauriiiOpened follow-up to clean this up a bit: #3373938: Comment settings are confusing.
Comment #7
smustgrave commentedVerified this issue following the steps in the summary. Also shown by the test-only patch.
#4 solved the issue.
Comment #10
catchCommitted/pushed to 11.x and cherry-picked to 10.1.x, thanks!