Suppose this caused by #384992: drupal_html_id does not work correctly in AJAX context with multiple forms on page
A bit debuging shows that $element['fid']['#value'] is empty in file_managed_file_validate()
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 770880-file-delete-d7.patch | 1.38 KB | andypost |
Comments
Comment #1
andypostSteps to reproduce:
1) add a file or image field to any node-type
2) create node of this type with uploaded file
3) try to edit node and press "Remove" to remove uploaded file
4) ...nothing happens
Patch to fix validation, suppose this check should happen when "Remove" clicked!
Comment #2
andypostpatch
Comment #3
sunThe patch looks wrong to me, as the following code within that condition is logic that applies _not_ to the remove_button.
Comment #4
andypostFixed with #736298: Refactor file.module to use proper button click detection, enabling FAPI to improve button click detection security
Suppose need test for file removing
Comment #5
effulgentsia commented#737686: Image field 'Remove' button broken contains a quick fix. #736298: Refactor file.module to use proper button click detection, enabling FAPI to improve button click detection security and #756762: AJAX should follow same rules for whether to call drupal_rebuild_form() as non-AJAX submissions fix the problem too, but will take some time to move through the review process.