Problem/Motivation
Validation messages for errors in section configuration forms do not get displayed because of #2897377: $form['#attributes']['data-drupal-selector'] is set to a random value so can't be used for its intended purpose.
Proposed resolution
Set the $form['#id'] explicitly so the messages will be displayed.
Remaining tasks
Review
User interface changes
The error messages will show.
API changes
None
Data model changes
None
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | interdiff_1-9.txt | 1.98 KB | raman.b |
| #9 | 3103812-9.patch | 3.94 KB | raman.b |
| #9 | 3103812-9-test-only.patch | 2.35 KB | raman.b |
| #2 | 3103812-1.patch | 1.59 KB | rromore |
Comments
Comment #2
rromore commentedComment #3
cilefen commentedComment #4
tim.plunkettI just hit this in contrib. NW for tests, but this is the correct fix.
Comment #6
b_sharpe commentedConfirming fixed for me as well, +1
Comment #8
sakiland commentedWorks for me too, thanks. Tested on Drupal 8.9.7
Comment #9
raman.b commentedAdding some test coverage for this
Comment #11
tim.plunkettThanks for the test coverage! I think this is ready to go.
Comment #12
alexpottWhy don't we fix #2897377: $form['#attributes']['data-drupal-selector'] is set to a random value so can't be used for its intended purpose instead of adding this workaround? That issue has test coverage and looks close?
Comment #13
tim.plunkettThis workaround exists in two other places already, as shown in that issue. Yes, someone (me) should take the time to review that other issue.
But I think this test coverage is valuable. So for me it makes more sense to commit this first.
If you disagree, should we take this test coverage and add it to the other issue?
Comment #14
alexpottI agree the test coverage is valuable. Let's go ahead here - only more to tidy up in the other issue. It does feel backwards to keep adding workarounds when the real fix is so close.
Committed and pushed 832592c1a4 to 9.2.x and 0e0a8ba1b8 to 9.1.x. Thanks!