?
avatar JANmed
JANmed
22 Apr 2016

Steps to reproduce the issue

Drag drop image

Expected result

Insert image in editor

Actual resultscreen shot 2016-04-22 at 13 52 08

Upload green bar blocked at 100% and no image is add

System information (as much as possible)

Latest version of joomla 3.5.1
Admintools with htaccess protection, php5.6

Additional comments

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
4.00

avatar JANmed JANmed - open - 22 Apr 2016
avatar dgt41
dgt41 - comment - 22 Apr 2016

@JANmed what is the name of the image?

avatar JANmed
JANmed - comment - 22 Apr 2016

@dgt41 Clipboard1.png or this one :
clipboard01

avatar JANmed
JANmed - comment - 22 Apr 2016

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}))});

issue

avatar dgt41
dgt41 - comment - 22 Apr 2016

One more thing, can you paste the JSON response (sources->XHR)?

avatar JANmed
JANmed - comment - 22 Apr 2016

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
avatar dgt41
dgt41 - comment - 22 Apr 2016

Nope sorry, the actual response:
screen shot 2016-04-22 at 22 24 32

avatar JANmed
JANmed - comment - 22 Apr 2016

Sorry as its first time i use firebug for bugs, is that response :+1:

{"status":"1","message":"Envoi termin\u00e9 : \/images\/issue22.jpg","error":"Envoi termin\u00e9 : \/images\/issue22.jpg","location":"\/images\/issue22.jpg"}

avatar dgt41
dgt41 - comment - 22 Apr 2016

Ok so I guess the é char is not valid.

avatar JANmed
JANmed - comment - 22 Apr 2016

é char !?
our website is in french and we have char like à é è ..

avatar dgt41
dgt41 - comment - 22 Apr 2016

Invalid for javascript, wrong encoding I guess

avatar JANmed
JANmed - comment - 22 Apr 2016

Thanks @dgt41 we didnt add anything, its a joomla core files !
what we should do ?

avatar dgt41
dgt41 - comment - 22 Apr 2016

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)
                );
avatar JANmed
JANmed - comment - 22 Apr 2016

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"}

avatar dgt41
dgt41 - comment - 22 Apr 2016

Can you try with 'script'=>false instead of true? (I am too busy to try that myself right now)

avatar JANmed
JANmed - comment - 22 Apr 2016

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"}

avatar JANmed
JANmed - comment - 22 Apr 2016

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 !

avatar dgt41
dgt41 - comment - 22 Apr 2016

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

avatar JANmed
JANmed - comment - 22 Apr 2016

i tried to change false to true and true to false and no way ..
its normal that i am alone getting this issue ?

thanks !

avatar brianteeman brianteeman - change - 22 Apr 2016
Priority Urgent Medium
avatar brianteeman
brianteeman - comment - 22 Apr 2016

Reset the priority according to the documented standards https://docs.joomla.org/Bug_and_Issue_Tracker_Priority


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10053.

avatar JANmed
JANmed - comment - 22 Apr 2016

I set it to level 4 !


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10053.

avatar JANmed
JANmed - comment - 22 Apr 2016

Thanks guys.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10053.

avatar dgt41
dgt41 - comment - 23 Apr 2016

@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?

avatar JANmed
JANmed - comment - 23 Apr 2016

Nope! always the same issue, seems like a js conflict some where ..

avatar JANmed
JANmed - comment - 23 Apr 2016

i disabled many extensions to check but still not working

avatar dgt41
dgt41 - comment - 23 Apr 2016

I just installed french and I don't get an error. Here is the response:
screen shot 2016-04-23 at 12 06 44

Mind that the message is: Envoi termin\u00e9&#160;:

avatar JANmed
JANmed - comment - 23 Apr 2016

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 ?

avatar JANmed
JANmed - comment - 23 Apr 2016

here's the list of extensions :
JEextensions.txt

avatar dgt41
dgt41 - comment - 23 Apr 2016

@JANmed what PHP version are you using?

avatar JANmed
JANmed - comment - 23 Apr 2016

version 5.6.20

avatar brianteeman
brianteeman - comment - 8 May 2016

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


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10053.

avatar brianteeman brianteeman - change - 8 May 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-05-08 09:10:44
Closed_By brianteeman
avatar brianteeman brianteeman - close - 8 May 2016
avatar brianteeman brianteeman - close - 8 May 2016

Add a Comment

Login with GitHub to post a comment