I'm using multiple forms in conjunction with plupload integration to allow uploading of multiple images at once.

My image file type has a required field, but I'm still able to save the multiple form without filling out this required field. I do get an error on the following page, but it saves nonetheless.

Comments

azinck’s picture

Title: Able to save entity even if required field not filled out » Form processing ignores validation errors

This seems to happen with any error on the form, not just required fields.

kpv’s picture

dave reid’s picture

Priority: Normal » Major
tobiasb’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new550 bytes

* The attached patch do not redirect the form with some errors.

* Problems is Drupal shows the red border on all fields (example) from the n-"forms"

crifi’s picture

Does somebody know the sense of $form_state['no_redirect'] and $redirect['no_redirect']? Maybe we should only unset $redirect['no_redirect'] without form errors?

miroslavbanov’s picture

Patch #4 did help for the media callback admin/content/file/edit-multiple to not redirect on validation error for me.

timwood’s picture

Issue summary: View changes
Status: Needs review » Needs work
Related issues: +#1870120: Add Delayed submit functionality - branch 7.x-2.x

Patch in #4 helps, but there is still an issue when the FIRST of multiple files being uploaded/edited does NOT have a validation error but subsequent files DOES. In this case parts of the resulting form are broken, a message appears that the one file was updated, yet that files fields are still part of the multiple form. Once you correct all validation errors for all files it will save.

lplp’s picture

Tried to reproduce the issue in #7 - having applied the patch in #4.

Yes I agree the files are not being handled ideally.
However I think that is a different issue. When all files are validated correctly, saving & redirecting works just fine and it will never save an uncorrectly validated file.

Whenever some of all added files still have errors, it will handle it differently each time (can't find the pattern just yet, didn't get the same issue as in #7 all the time). Sometimes it will go ahead and update the correctly validated files and give an error for the uncorrect ones. Sometimes it will just give the error and wait for you to have all the files correct before proceedng. But it will never save an uncorrect file and it will wait for you to correct it before redirecting, which is good.

SO at least the patch in #4 does fix the redirect problem and it will not update files that have an error, only correct ones.
I think patch #4 works but a new issue shoud be submitted for the issue in #7.

joseph.olstad’s picture

StatusFileSize
new550 bytes

#7 issue was fixed in release 7.x-1.3

lets queue this patch for testing

joseph.olstad’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 9: multiform-1663212-9.patch, failed testing.

iliana_ng’s picture

StatusFileSize
new550 bytes

I submit an update of #1 patch for 7.x-1.3 version

joseph.olstad’s picture

Status: Needs work » Needs review

trigger tests

joseph.olstad’s picture

@iliana_ng , had a look at your patch, it is the same patch as patch #9 , therefore, expect 1 fail.

Status: Needs review » Needs work

The last submitted patch, 12: multiform-1663212-12.patch, failed testing.

stefan.korn’s picture

StatusFileSize
new1.04 KB

Providing reworked patch, that does change tests as well. While not very familiar with testing, I suppose there is something wrong with the tests rather than with the patch from 9 and 12 itself.

So hopefully this will now pass the tests.

stefan.korn’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 16: multiform-1663212-16.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

stefan.korn’s picture

StatusFileSize
new1.17 KB

hm, give it another try.

stefan.korn’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 19: multiform-1663212-19.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

stefan.korn’s picture

StatusFileSize
new1.09 KB

Sorry for the noise, but I have no local testing environment. So trying another one.

stefan.korn’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 22: multiform-1663212-22.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

stefan.korn’s picture

StatusFileSize
new1.58 KB

and again

stefan.korn’s picture

Status: Needs work » Needs review
stefan.korn’s picture

Ok, now finally the test passed. As I explained before, I am not very experienced with testing, so someone should surely check my changes in the test file.
But I think there was something wrong within the test and maybe the tests where seeming to succeed previously because the error handling was not correct at all.

joseph.olstad’s picture

Status: Needs review » Reviewed & tested by the community
chris matthews’s picture

Would it be possible to commit the patch in #25 to 7.x-1x-dev and tag a 7.x-1.5 release?

joseph.olstad’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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