Closed (fixed)
Project:
Plup
Version:
7.x-1.0-alpha1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 Jun 2012 at 14:15 UTC
Updated:
3 Jul 2012 at 16:54 UTC
Jump to comment: Most recent
I got a field with multiple value for image wich is required. If I delete the first image and I submit, a message error of requierd appear.
I make this in validate function of my form
if(count($form_state ['values']['field_photos'] [LANGUAGE_NONE])==1 && (isset($form_state ['values']['field_photos'] [LANGUAGE_NONE][0]['fid']) && $form_state ['values']['field_photos'] [LANGUAGE_NONE][0]['fid']==0))
form_set_error('field_photos',t('Photos obligatoires'));
Comments
Comment #0.0
musa.thomaschange code
Comment #1
phil_l commentedI have the same problem. While my multiple image field is required i am not allowed to delete the first image unless i want the "field is required" error message.
When i set the field to not required deleting images works just fine.
So i took a look into the module's code and it seems like the image field validation needs more conditions to work properly.
Comment #2
Anonymous (not verified) commentedFixed in latest dev.
Comment #2.0
Anonymous (not verified) commentedchange code