User tests: Successful: Unsuccessful:
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.
Labels |
Added:
?
|
Category | ⇒ | JavaScript |
I suppose this needs more explanation.
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.
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.
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.
@test success. replicated issue described and patch fixed it. No other warnings noticed in media manager when applying the patch either
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-12-28 02:17:49 |
Milestone |
Added: |
Merged - thanks!
@test Ok with #3919 and #5077