? Pending

User tests: Successful: Unsuccessful:

avatar astridx
astridx
17 Jan 2018

menus edit item test administration
Pull Request

Summary of Changes

We have error in our HTML markup in the backend, because we use double quotation mark, that is not escaped. You can find this, if you create an menu item of the type single article.

If search for the ID ModalEditArticle_jform_request_id this looks like

<div 
id="ModalEditArticle_jform_request_id" 
role="dialog" tabindex="-1" 
class="joomla-modal modal fade"
data-backdrop="static" 
data-keyboard="false" 

data-url="index.php?option=com_content&amp;view=article&amp;layout=modal&amp;tmpl=component&amp;d999480f48f1b6c1cb2ca1893c0c4d89=1&amp;task=article.edit&amp;id=' + document.getElementById("jform_request_id_id").value + '" 

data-iframe="&lt;iframe class=&quot;iframe&quot; src=&quot;index.php?option=com_content&amp;amp;view=article&amp;amp;layout=modal&amp;amp;tmpl=component&amp;amp;d999480f48f1b6c1cb2ca1893c0c4d89=1&amp;amp;task=article.edit&amp;amp;id=' + document.getElementById(&quot;jform_request_id_id&quot;).value + '&quot; name=&quot;Edit Article&quot; height=&quot;400px&quot; width=&quot;800px&quot;&gt;&lt;/iframe&gt;">
. . .

The attribute data-url is not valid because of the double quotation marks near jform_request_id_id

This PR escapes this characters.

Testing Instructions

Code review

Documentation Changes Required

No

9907c73 17 Jan 2018 avatar astridx wip
avatar astridx astridx - open - 17 Jan 2018
avatar astridx astridx - change - 17 Jan 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 17 Jan 2018
Category Administration com_content
avatar joomla-cms-bot joomla-cms-bot - edited - 17 Jan 2018
avatar Quy Quy - change - 17 Jan 2018
Title
Error in HTML markup because of not escape double quotation mark in the value of the attribut data-url
[4.0] Error in HTML markup because of not escape double quotation mark in the value of the attribut data-url
avatar dgt41
dgt41 - comment - 17 Jan 2018

That part of the url is really ugly, we shouldn't pass a js command there in the first place. I haven't see all the logic behind this but I'm guessing we could somehow utilise the js Joomla.optionsStorage to pass from the PHP the ID and manipulate the url in a more decent way. Anyhow your PR should be sufficient to remove the error for now but at some point we need to revisit the whole logic here.
Thanks for patching this!

avatar astridx astridx - change - 17 Jan 2018
The description was changed
avatar astridx astridx - edited - 17 Jan 2018
avatar wilsonge wilsonge - change - 1 Feb 2018
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2018-02-01 22:36:03
Closed_By wilsonge
Labels Added: ?
avatar wilsonge wilsonge - close - 1 Feb 2018
avatar wilsonge wilsonge - merge - 1 Feb 2018
avatar wilsonge
wilsonge - comment - 1 Feb 2018

Thanks :)

Add a Comment

Login with GitHub to post a comment