Hi,

This problem appear if one of the validation function return an error.
I have made a field that has the widget. The field has a validation for extensions,size and minim image size and no more than seven items.

  1. I try to upload only one image with wrong size. The result is in the image1.png
  2. I try to upload multiple files in the same time. The field is set to maxim 7 files. All selected files are different resolution sizes.
    I hit upload and the result is on image3.png. Is not what i expected.
  3. I try to remove a picture from the list or to upload other. all images dissapears.

Other scenarios.

  1. I try to upload only one image good picture
  2. I try to upload 10 picture with good and wrong picture. The result is the same like in the step 2 of the first scenario
  3. I try to remove a picture from the list or to upload other. all images dissapears excepts the first one.

Other scenarios.

  1. I try to upload 10 picture with good and wrong picture. Spouse the first picture is good . The result is the same like in the step 2 of the first scenario
  2. I try to remove a picture from the list or to upload other. all images dissapears excepts the first one that is a good one.
CommentFileSizeAuthor
image3.png88.81 KBCaDyMaN
image2.png10.83 KBCaDyMaN
image1.png15.4 KBCaDyMaN
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

CaDyMaN created an issue.

CaDyMaN’s picture

Hello,

The problem appear because of the of "form_set_error".
Is normal what is happen. However the images should be removed if error occurred.
Any way i study the module in details and is safe to replace form_set_error with drupal_set_messages but not directly in the module.
Use hook_element_info_alter and hook_field_widget_form_alter in order to replace '#value_callback' to point to copy of the methods where you can make any changes safely.

on 16.01.2016
I figure out that if you select bad images and submit the form without upload action first the error will occurs again, However it can auto submit the form after the image are selected ..