Drag drop image
Insert image in editor
Upload green bar blocked at 100% and no image is add
Latest version of joomla 3.5.1
Admintools with htaccess protection, php5.6
Here a better screenshot and a copy of the code :
tinymce.PluginManager.add("jdragdrop",function(e){function t(t){var r=new FormData;r.append("Filedata",t),r.append("folder",mediaUploadPath);var o=new XMLHttpRequest;o.upload.onprogress=function(e){var t=e.loaded/e.total*100;jQuery(".bar").width(t+"%")},removeProgessBar=function(){setTimeout(function(){jQuery("#jloader").remove(),e.contentAreaContainer.style.borderWidth=""},200)},o.onload=function(){var e=JSON.parse(o.responseText);if(200==o.status){if("0"==e.status&&(removeProgessBar(),tinyMCE.activeEditor.windowManager.alert(e.message+": "+setCustomDir+e.location)),"1"==e.status){removeProgessBar();var t=tinyMCE.activeEditor.getDoc().createElement("img");t.src=setCustomDir+e.location,tinyMCE.activeEditor.execCommand("mceInsertContent",!1,t.outerHTML)}}else removeProgessBar()},o.onerror=function(){removeProgessBar()},o.open("POST",uploadUri,!0),o.send(r)}tinyMCE.DOM.bind(document,"dragleave",function(e){return e.stopPropagation(),e.preventDefault(),tinyMCE.activeEditor.contentAreaContainer.style.borderWidth="",!1}),"undefined"!=typeof FormData?(e.on("dragenter",function(e){return e.stopPropagation(),!1}),e.on("dragover",function(e){return e.preventDefault(),tinyMCE.activeEditor.contentAreaContainer.style.borderStyle="dashed",tinyMCE.activeEditor.contentAreaContainer.style.borderWidth="5px",!1}),e.on("drop",function(r){if(r.dataTransfer&&r.dataTransfer.files&&r.dataTransfer.files.length>0)for(var o,n=0;o=r.dataTransfer.files[n];n++)o.name.toLowerCase().match(/\.(jpg|jpeg|png|gif)$/)&&(jQuery(".mce-toolbar-grp").append('<div id="jloader"> <div class="progress progress-success progress-striped active" style="width:100%;height:30px;"> <div class="bar" style="width: 0%"></div> </div></div>'),e.contentAreaContainer.style.borderWidth="",t(o)),r.preventDefault();e.contentAreaContainer.style.borderWidth=""})):(Joomla.renderMessages({error:[Joomla.JText._("PLG_TINY_ERR_UNSUPPORTEDBROWSER")]}),e.on("drop",function(e){return e.preventDefault(),!1}))});
One more thing, can you paste the JSON response (sources->XHR)?
This one i guess ?
21:16:35,744 SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
t/o.onload() plugin.min.js:1
1 plugin.min.js:1:410
Sorry as its first time i use firebug for bugs, is that response
{"status":"1","message":"Envoi termin\u00e9 : \/images\/issue22.jpg","error":"Envoi termin\u00e9 : \/images\/issue22.jpg","location":"\/images\/issue22.jpg"}
Ok so I guess the é char is not valid.
é char !?
our website is in french and we have char like à é è ..
Invalid for javascript, wrong encoding I guess
You can try replacing the lines 188-193 of administrator/components/com_media/controllers/file.json.php with this:
$response = array(
'status' => '1',
'message' => JText::sprintf('COM_MEDIA_UPLOAD_COMPLETE', $returnUrl, array('jsSafe'=>true, 'interpretBackSlashes'=>false, 'script'=>true)),
'error' => JText::sprintf('COM_MEDIA_UPLOAD_COMPLETE', $returnUrl, array('jsSafe'=>true, 'interpretBackSlashes'=>false, 'script'=>true)),
'location' => str_replace('\\', '/', $returnUrl)
);
Thanks, just replaced it and seems to dosent work too, the green upload bar block on 100%
i get this :
{"status":"1","message":"COM_MEDIA_UPLOAD_COMPLETE","error":"COM_MEDIA_UPLOAD_COMPLETE","location":"\/images\/issue223.jpg"}
Can you try with 'script'=>false
instead of true? (I am too busy to try that myself right now)
Seems that there is a real problem, even with the script false no way to get it working :(
{"status":"1","message":"Envoi termin\u00e9 : \/images\/issue10.jpg","error":"Envoi termin\u00e9 : \/images\/issue10.jpg","location":"\/images\/issue10.jpg"}
All files are uploaded correctly when i check the images folder!
seems thats the script is blocked to return the values and insert image in editor !
Yes, it's the encoding that is wrong. Probably if you mess with those true, false options you'll be able to make it work
i tried to change false to true and true to false and no way ..
its normal that i am alone getting this issue ?
thanks !
Priority | Urgent | ⇒ | Medium |
Reset the priority according to the documented standards https://docs.joomla.org/Bug_and_Issue_Tracker_Priority
I set it to level 4 !
Thanks guys.
@JANmed can you replace media/editors/tinymce/plugins/jdragdrop/plugin.min.js
with https://gist.github.com/dgt41/88ddf67e0da59256fc881b9cb1df5fed and report if the problem is solved?
Nope! always the same issue, seems like a js conflict some where ..
i disabled many extensions to check but still not working
Yes i have the same messages, images are well uploaded in media folder, i can found them all !
maybe you need to check the system information file ? txt or json ?
here's the list of extensions :
JEextensions.txt
version 5.6.20
It really looks as this issue is something specific to you as we have had no other reports of this and Dimitri has been unable to replicate this despite trying very hard.
Without replicating it the problem is almost impossible to resolve so I am closing this at this time. It can always be re-opened if needed
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-05-08 09:10:44 |
Closed_By | ⇒ | brianteeman |
@JANmed what is the name of the image?