Can't Remove Image from CCK File Field when editing node (Throbber just spins)
-
16-10-2019 - |
Question
I was able to upload an image, but the thumbnail didn't appear until I hit save on the form. When I try to remove the image, it just sits there spinning the throbber; if I click on "Save" in the form, the image is not removed.
I think this has to do with AJAX getting caught up somewhere, but I don't know how to go about troubleshooting this.
Do you have any idea? I've tried switching the field from "Bar with progress meter" to "Throbber" and that didn't help.
Edit:
I forgot that I updated jQuery to the latest version and used some special code to prevent it from affecting the backend. Here is the jquery_update_jquery_path() function from jquery_update.module (I modified it to fix this issue by checking for 'edit' in the uri):
function jquery_update_jquery_path() {
$curr_uri = request_uri();
if (strpos($curr_uri, 'admin') > 0 || strpos($curr_uri, 'edit') > 0) {
$jquery_file = array('none' => 'jquery.js', 'min' => 'jquery.min.js');
return JQUERY_UPDATE_REPLACE_PATH .'/'. $jquery_file[variable_get('jquery_update_compression_type', 'min')];
}
else {
$jquery_file = array('none' => 'jquery-1.5.2.js', 'min' => 'jquery-1.5.2.min.js');
return JQUERY_UPDATE_REPLACE_PATH .'/'. $jquery_file[variable_get('jquery_update_compression_type', 'min')];
}
}
Solution
What version of JQuery are you running? I had an AJAX issue (was trying to rebuild derivative images for all nodes of a specific node-type) when using JQuery 1.5.1 instead of the version that is shipped with Drupal 6. Removing 1.5.1 and adding the stock version of JQuery resolved the issue.
OTHER TIPS
I was going to say it was probably permission-related (no delete permission) but if you managed by turning off javascript than its definitely not that.
Turn on firebug, enable the console & turn javascript back on.
If its an ajax error it will show up in the firebug console.