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.

image1
image2
image3

Comments

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.