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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

metzlerd created an issue. See original summary.

metzlerd’s picture

metzlerd’s picture

Status: Active » Needs review
metzlerd’s picture

The last submitted patch, 2: fapi-modal-errors-2870746.patch, failed testing.

metzlerd’s picture

FYI: #5 was really about first empty patch uploaded. This patch should be ready for review.

Sorry for any confusion caused.

Lal_’s picture

Looks like the patch applies properly.

Mile23’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests
Related issues: +#2883725: fapi_example modal dialog does not show result message w/ JS

After 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.

Mile23’s picture

Assigned: metzlerd » Unassigned
Mile23’s picture

Status: Needs work » Postponed
Mile23’s picture

Title: Modal form validation. » Add JS functional tests for modal example, including validation phase
Status: Postponed » Needs work

#2838276: Modal Form Example not working gives us a basic behavior, so now we can test and fix the validation phase.

Mile23’s picture

Assigned: Unassigned » Mile23

Working on this.

Mile23’s picture

Status: Needs work » Needs review
FileSize
10.86 KB

Moving 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.

Status: Needs review » Needs work

The last submitted patch, 13: 2870746_13.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

Mile23’s picture

Status: Needs work » Needs review
FileSize
11.31 KB
3.92 KB

  • Mile23 committed 3fbc62d on 8.x-1.x
    Issue #2870746 by Mile23, metzlerd, AbhishekLal: Add JS functional tests...
Mile23’s picture

Status: Needs review » Fixed

Fix-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.

Mile23’s picture

Component: FAPI Example » Form API Example

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.