? Success

User tests: Successful: Unsuccessful:

avatar okonomiyaki3000
okonomiyaki3000
10 Nov 2014

The editor button 'image' pops up a dialog that allows you to navigate the media manager's files. There's a select in this dialog full of directories that you might want to navigate to but it doesn't work. This is because of a php string being inserted into js code as-is. It needs to be json encoded (typically this just means putting it in quotes) first.

avatar okonomiyaki3000 okonomiyaki3000 - open - 10 Nov 2014
avatar jissues-bot jissues-bot - change - 10 Nov 2014
Labels Added: ?
avatar anibalsanchez
anibalsanchez - comment - 10 Nov 2014

@test Ok with #3919 and #5077

avatar brianteeman brianteeman - change - 11 Nov 2014
Category JavaScript
avatar okonomiyaki3000
okonomiyaki3000 - comment - 12 Dec 2014

I suppose this needs more explanation.

Problem

Create a new article (the issue will not occur if you open an existing article) and, before saving it, click the 'image' button. Now try to use use the 'Directory' selector in the modal dialog. It shall not work.

Cause

When the article has already been saved, it will have an asset id which is an integer. This will be inserted into a line of javascript and there will be no problem. However, if the article has not been saved yet, it will not have an asset id so a string will be used instead but this string is not being properly prepared to be inserted into javascript. Basically it needs to be quoted but it may also need to be trimmed and the quotes need to be escaped because it will be used in an attribute of an html tag.

Fix

After applying this patch, the Directory select will work properly in all cases because, when the value is a string, it will be properly escaped and quoted.

avatar anibalsanchez
anibalsanchez - comment - 12 Dec 2014

@test success, patch fixes the issue, tested in the latest staging

avatar anibalsanchez anibalsanchez - test_item - 12 Dec 2014 - Tested successfully
avatar wilsonge
wilsonge - comment - 28 Dec 2014

@test success. replicated issue described and patch fixed it. No other warnings noticed in media manager when applying the patch either


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

avatar wilsonge wilsonge - test_item - 28 Dec 2014 - Tested successfully
avatar wilsonge wilsonge - reference | bbbc3ba - 28 Dec 14
avatar wilsonge wilsonge - merge - 28 Dec 2014
avatar wilsonge wilsonge - close - 28 Dec 2014
avatar wilsonge wilsonge - close - 28 Dec 2014
avatar wilsonge wilsonge - change - 28 Dec 2014
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2014-12-28 02:17:49
avatar wilsonge wilsonge - change - 28 Dec 2014
Milestone Added:
avatar wilsonge
wilsonge - comment - 28 Dec 2014

Merged - thanks!

avatar okonomiyaki3000 okonomiyaki3000 - head_ref_deleted - 29 Dec 2014

Add a Comment

Login with GitHub to post a comment