? Pending

User tests: Successful: Unsuccessful:

avatar chrisdavenport
chrisdavenport
15 Mar 2019

Pull Request for Issue #16954 .

Summary of Changes

The operator precedence in showon expressions was not working as expected, that is, from left to right. All operators prior to the right-most were being ignored completely.

Testing Instructions

Set up a form using the XML file (which is actually the .txt file in the attached zip). This has three fields (Field 1, Field 2 and Field3) which can each be set to Yes or No. Depending on the state of these fields, further fields will be shown or hidden according to the showon expressions they contain. All possible operator combinations for the three fields are included. Change the field states and compare with the spreadsheet in the attached zip which shows the actual and expected results.

Expected result

As per the Expected section of the spreadsheet in the attached zip.

Actual result

As per the Actual section of the spreadsheet in the attached zip.

Documentation Changes Required

Add a note to https://docs.joomla.org/Form_field to explain that left-right precedence should be expected.

showon-issue-16954.zip

avatar chrisdavenport chrisdavenport - open - 15 Mar 2019
avatar chrisdavenport chrisdavenport - change - 15 Mar 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 15 Mar 2019
Category JavaScript
avatar chrisdavenport
chrisdavenport - comment - 15 Mar 2019

The cms.js file will also need to be amended. Any preference on minifiers?

avatar wilsonge
wilsonge - comment - 15 Mar 2019

Not in j3. take your pick

avatar chrisdavenport chrisdavenport - change - 15 Mar 2019
Labels Added: ?
avatar chrisdavenport
chrisdavenport - comment - 15 Mar 2019

Minified file added.

avatar dgrammatiko
dgrammatiko - comment - 15 Mar 2019
avatar Quy
Quy - comment - 16 Mar 2019

I have tested this item successfully on 82f49c0


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

avatar Quy Quy - test_item - 16 Mar 2019 - Tested successfully
avatar HLeithner HLeithner - change - 17 Mar 2019
Title
Fixed left-right operator precedence in showon expressions.
[3.9] Fixed left-right operator precedence in showon expressions.
avatar HLeithner HLeithner - edited - 17 Mar 2019
avatar HLeithner HLeithner - change - 2 Apr 2019
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2019-04-02 15:15:15
Closed_By HLeithner
avatar HLeithner HLeithner - close - 2 Apr 2019
avatar HLeithner HLeithner - merge - 2 Apr 2019
avatar HLeithner
HLeithner - comment - 2 Apr 2019

I tested it successful. thx

avatar gwsdesk
gwsdesk - comment - 3 Apr 2019

I have tested this item successfully on 82f49c0

Add a Comment

Login with GitHub to post a comment