It would be nice if we could handle validation errors better so that the uploads aren't simply lost.

A possible solution would be trying to move the submit to a validate or some such.

Comments

playfulwolf’s picture

Version: » 7.x-1.0-alpha1
Priority: Normal » Major

Can confirm this. If a form has any required field, which is not populated - nothing happens after file upload. It makes this module usable just on (very) rare occasions, where are no required fields or they are already filled.

Mołot’s picture

Agreed, wanted to use it but now I can't.

falc0’s picture

Same here.
Files are lost when using a custom validation:

function hook_file_validate($file) {
  $image = image_get_info($file->uri);
  $errors = array();
  if ((int)$image['width'] < 400) {
    $errors[] = t('The minimum width is 400px.');
  }
  return $errors;
}

When I use the core validation on minimum image resolution it works fine.

ethan.han777’s picture

I created a patch for this issue.
it should skip the form validation when "start upload" button is clicked.

Cheers

ethan.han777’s picture

Status: Active » Needs review
joseph11’s picture

Patch works for me. Thanks.

ethan.han777’s picture

Status: Needs review » Reviewed & tested by the community

  • ram4nd committed 2c6cc9e on 7.x-1.x authored by ethan.han777
    Issue #1797886 by ethan.han777, jec006, joseph11: If validation fails,...
ram4nd’s picture

Component: User interface » Code
Priority: Major » Normal
Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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