?
Referenced as Pull Request for: # 10698
avatar mbabker
mbabker
31 May 2016

Steps to reproduce the issue

A combination of #9665 and the HTML5 declarations for the core templates has caused the keepalive behavior to misbehave in the backend. Unencoding the ampersand makes it work again.

Expected result

A request to administrator/index.php?option=com_ajax&format=json with a 200 response

Actual result

A request to administrator/index.php?option=com_ajax&format=json with a 404 response

Additional comments

Checking $doc->isHtml5() isn't enough here because the core templates set this flag when they get rendered, long after the component is rendered and calls this behavior.

avatar mbabker mbabker - open - 31 May 2016
avatar andrepereiradasilva
andrepereiradasilva - comment - 31 May 2016

that i know of there is no html error in having keepalive without the & in html5 ...

For render as XHTML the problem is not the &, the problem is that for correct xhtml rendereing the scipts should be inside CDATA

Example:

This does gives error in w3c validator

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>Home</title>
    <script type="text/javascript">
        var a="/index.php?option=com_ajax&format=json";
    </script>
</head>
<body>
    <p>&nbsp;</p>
</body>
</html>

This doesn't gives error in w3c validator

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>Home</title>
    <script type="text/javascript">
    //<![CDATA[
        var a="/index.php?option=com_ajax&format=json";
    //]]>
    </script>
</head>
<body>
    <p>&nbsp;</p>
</body>
</html>
avatar andrepereiradasilva
andrepereiradasilva - comment - 31 May 2016
avatar andrepereiradasilva
andrepereiradasilva - comment - 31 May 2016

IMHO solution #9665 doesn't make sense because you are making a ajax call with a incorrect URL.

i think it as noting to do with the html5 change.

avatar andrepereiradasilva
andrepereiradasilva - comment - 31 May 2016

so first let's correct keepalive url.

And them we could try to fix xml errors

avatar andrepereiradasilva
andrepereiradasilva - comment - 31 May 2016

PR to fix the keealive URL part #10698

avatar andrepereiradasilva
andrepereiradasilva - comment - 31 May 2016

actually the CDATA is already in JDocument html render and it depends on the mimetype. This seems a correct behaviour IMO.

See https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/document/renderer/html/head.php#L254-L258

avatar andrepereiradasilva
andrepereiradasilva - comment - 31 May 2016

so IMO this should be closed.

avatar brianteeman brianteeman - change - 31 May 2016
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - close - 1 Jun 2016
avatar zero-24 zero-24 - change - 1 Jun 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-06-01 05:04:43
Closed_By zero-24
avatar zero-24
zero-24 - comment - 1 Jun 2016

Set to "closed" on behalf of @zero-24 by The JTracker Application at issues.joomla.org/joomla-cms/10697

Add a Comment

Login with GitHub to post a comment