Delete button not working properly
| Project: | Image Upload |
| Version: | 6.x-1.2 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Follow these steps:
1) Click on create content >> whatever you want
2) Upload an image
3) Check de image, and the push the Delete button
This causes the form to submit, instead of doing the ajax call, and the item is not deleted.
Seems that when you upload an image, the image_upload_js function rebuilds the form, and the ahah of the Delete button does not work.
You can check this because after uploading an image the class of the Delete button is class="form-submit" instead of class="form-submit ahah-processed".
When the form is fully submitted, then the Delete button class is class="form-submit ahah-processed" and it works.
Maybe the del button ahah content doesn't work if it hasn't been initialized in the $(document).ready because it didn't exists in the .ready event.
Perhaps loading initially the button as "hidden" may be a solution ?

#1
I can confirm that rendering the Delete Button (in hidden mode if there's no images to list) in the first form load solves the problem.
#2
Could I get this as a patch, please?
#3
Sorry I haven't done it. Just changed the delete button creation position (to be always created) and I noticed that It worked.