Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The modal form validation no longer displays the form errors (missing required field). I'm not sure when this changed, but the status_messages element needs to be moved into the form building function and outside of the ajax submit handler in order to properly handle form errors.
Working on a patch.
Comment | File | Size | Author |
---|---|---|---|
#15 | interdiff.txt | 3.92 KB | Mile23 |
#15 | 2870746_15.patch | 11.31 KB | Mile23 |
| |||
#13 | 2870746_13.patch | 10.86 KB | Mile23 |
#4 | fapi-modal-errors-2870746.patch | 1.47 KB | metzlerd |
|
Comments
Comment #2
metzlerd CreditAttribution: metzlerd commentedComment #3
metzlerd CreditAttribution: metzlerd commentedComment #4
metzlerd CreditAttribution: metzlerd commentedComment #6
metzlerd CreditAttribution: metzlerd commentedFYI: #5 was really about first empty patch uploaded. This patch should be ready for review.
Sorry for any confusion caused.
Comment #7
Lal_Looks like the patch applies properly.
Comment #8
Mile23After applying this patch, go to this path (with JS turned on): examples/fapi-example/modal-form
Submit a title. You'll see that there is no submit handler message. However, if you reload the patch, you see the submit handler message.
Then, if you go to the main page for this module: examples/fapi-example
Click on the 'Modal Form' link and submit a title. You'll see the submit handler message as it should be on the page. Now, if you click the Modal Form link again, you'll see the status message again in the UI modal form.
I might have just filed a duplicate issue for this here: #2883725: fapi_example modal dialog does not show result message w/ JS
Please mark it dupe if it is. Thanks.
Also, we'll need a test for this. I think it might end up being a javascript functional test.
Comment #9
Mile23Comment #10
Mile23Postponed on #2838276: Modal Form Example not working
Comment #11
Mile23#2838276: Modal Form Example not working gives us a basic behavior, so now we can test and fix the validation phase.
Comment #12
Mile23Working on this.
Comment #13
Mile23Moving things around, working on the JS functional test. There are some problems with the test system: #2831506: Minimal profile disallows modal AJAX tests under JavascriptTestBase
This will fail.
Comment #15
Mile23This should be it.
There are todos about #2831506: Minimal profile disallows modal AJAX tests under JavascriptTestBase
Comment #17
Mile23Fix-O-Rama.
Now we have functional testing of the modal form.
This specific example should maybe be in the AJAX example, or maybe adding @see type stuff in the docblocks and human-readable parts.
Comment #18
Mile23