Index: /Users/seb/Dev/ows/franceculture/trunk/sites/all/modules/fc/imagefield_crop/imagefield_crop_widget.inc =================================================================== --- /Users/seb/Dev/ows/franceculture/trunk/sites/all/modules/fc/imagefield_crop/imagefield_crop_widget.inc (revision 2645) +++ /Users/seb/Dev/ows/franceculture/trunk/sites/all/modules/fc/imagefield_crop/imagefield_crop_widget.inc (working copy) @@ -231,6 +231,18 @@ } function imagefield_crop_widget_value($element, $edit = FALSE) { + + // dirty way to check if the filefield Remove button was clicked to prevent + // issue http://drupal.org/node/501964 inspired by filefield_widget_process() + $filefield_remove = array( + '#name' => implode('_', $element['#parents']) .'_filefield_remove', + '#value' => t('Remove'), + '#post' => $element['#post'], + ); + if (_form_button_was_clicked($filefield_remove)) { + return; + } + if ($edit && isset($edit['data'])) { $file = field_file_load($edit['fid']); $field = content_fields($element['#field_name'], $element['#type_name']);