? Pending

User tests: Successful: Unsuccessful:

avatar GeraintEdwards
GeraintEdwards
3 Oct 2017

… maintain backwards compatability

Fixes issue #18203

Pull Request for Issue # .

Summary of Changes

Added return value to window.listItemTask

Testing Instructions

create an HTML file in the root of your Joomla installation with this HTML content

<html>
    <head>
        <title>Test of listItemTask</title>
        <script src="media/system/js/core-uncompressed.js" type="text/javascript" ></script>
    </head>
    <body>
        <form id="adminForm" name="adminForm">
            <input id="task" name="task" type="text" />
            <input id="boxchecked" name="boxchecked" type="checkbox" />
            <br>
            <input type="button" onclick="test()" value="click to test" />
        </form>
        <script type="text/javascript">
            function test() 
            {
                alert(listItemTask('task', 'xx.task'));
            }
        </script>
    </body>
</html>

Expected result

when you load the file and click the button you should see an alert with 'false' appear very briefly before the page refreshes .

Actual result

Without this change you will get an 'undefined in the popup

Documentation Changes Required

avatar joomla-cms-bot joomla-cms-bot - change - 3 Oct 2017
Category JavaScript
avatar GeraintEdwards GeraintEdwards - open - 3 Oct 2017
avatar GeraintEdwards GeraintEdwards - change - 3 Oct 2017
Status New Pending
avatar GeraintEdwards GeraintEdwards - change - 3 Oct 2017
The description was changed
avatar GeraintEdwards GeraintEdwards - edited - 3 Oct 2017
avatar GeraintEdwards GeraintEdwards - change - 3 Oct 2017
The description was changed
avatar GeraintEdwards GeraintEdwards - edited - 3 Oct 2017
avatar GeraintEdwards
GeraintEdwards - comment - 3 Oct 2017

Here is a better test script that illustrates the problem

<html>
    <head>
        <title>Test of listItemTask</title>
        <script src="media/system/js/core-uncompressed.js" type="text/javascript" ></script>
    </head>
    <body>
        <form id="adminForm" name="adminForm">
            <input id="cb0" name="cb0" type="checkbox" />
            <input id="task" name="task" type="text" />
            <input id="boxchecked" name="boxchecked" type="text" value="0" />
            <br>
            <a href="index.php" onclick="return listItemTask('cb0', 'xx.task');" >click to test</a>
        </form>
    </body>
</html>

the listItemTask method should return false and therefore block the tag link from working

Without the patch the page redirects to index.php instead of following the form submission

avatar tonypartridge tonypartridge - test_item - 3 Oct 2017 - Tested successfully
avatar tonypartridge
tonypartridge - comment - 3 Oct 2017

I have tested this item successfully on 68a4875

Tested, have a function listing items which uses listItemTask within a href. Applied fix, links no longer take you to # and instead operate the redirect within the function.


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

avatar brianteeman brianteeman - test_item - 4 Oct 2017 - Tested successfully
avatar brianteeman
brianteeman - comment - 4 Oct 2017

I have tested this item successfully on 68a4875

As this fixes a B/C break in 3.8 can this please go into 3.8.1 @mbabker


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

avatar mbabker mbabker - change - 4 Oct 2017
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2017-10-04 11:32:32
Closed_By mbabker
Labels Added: ?
avatar mbabker mbabker - close - 4 Oct 2017
avatar mbabker mbabker - merge - 4 Oct 2017

Add a Comment

Login with GitHub to post a comment