This appears to be a regression.
If you upload a new image or edit an existing one, you will see:
[[wysiwyg_imageupload::]]
instead of something like
[[wysiwyg_imageupload:1355:]]
A symptom of this problem is that the ajax that submits the form upon hitting the "INSERT" button is failing to return json. Instead it's returning markup
![]()
This form is rendered in sites/all/modules/wysiwyg_imageupload/wysiwyg_imageupload.form.inc in the wysiwyg_imageupload_edit_form function. The piece of code looking for a JSON string is in sites/all/modules/wysiwyg_imageupload/plugins/imgupload/imgupload.js around line 86. Since json isn't returned we get an error of "Parseerror" as shown in the console after I added an error handler on this form submission like so:
var form = $(dialogIframe).contents().find('form#wysiwyg-imageupload-edit-form');
form.ajaxSubmit({
dataType : 'json',
method: 'post',
async: false,
data: {
submitimagedetails : 'JSinsert',
parent_build_id: Drupal.settings.wysiwyg_imageupload.current_form
},
success : function(data,status,xhr,jq) {
console.log(data);
console.log(status);
iid = data.data.iid;
if(!iid) {
return;
}
},
error: function(one,two,three) {
console.log(one);
console.log(two);
console.log(three);
console.log('There was an error in add');
}
});
Note that iid=0 above so that is part of the reason we get jack in the tag. iid is set in the success handler. It turns out that what is said in #825180 is true and there is nothing being sent in "submitted" key on the form state.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | wysiwyg_imageupload-dialog_returns_empty_img_tag-2827841-3.patch | 904 bytes | generalredneck |
| #2 | wysiwyg_imageupload-dialog_returns_empty_img_tag-2827841-2.patch | 847 bytes | generalredneck |
| 2016-11-14_1716.png | 1.2 MB | generalredneck |
Comments
Comment #2
generalredneckComment #3
generalredneckRemoved the button from view.
Comment #4
mcpuddin commentedI can confirm this as well and the patch does work. I'm not 100% sure, but I recently updated my Drupal 6 core system and that might've made the previous fix for #825180: Dialog returns empty img tag invalid, but I haven't actually confirmed that... doubt this will go anywhere, but the patch looks good to me! haha
Comment #5
mcpuddin commentedComment #6
sano commentedthank you for the patch.