? Pending

User tests: Successful: Unsuccessful:

avatar Bakual
Bakual
27 Jan 2020

When adjusting a J3 extension to the new J4 UI style, we face the issue that in J3 the radio options in the XML are usually ordered with values descending (so "Yes" is defined first and appears left), while the switcher expects the options ascending (so "Yes" is defined last and appears right).
This is quite a bit of work which we could ease by adding one line into the switcher JLayout.
Since the switcher looks quite unexpected with "wrong" ordering, I don't see a disadvantage in forcing the "correct" ordering. But maybe I miss a usecase where an inversed order would be desired.

Summary of Changes

This PR automatically orders the switcher options, so it doesn't matter in which order they are written in the XML.

Testing Instructions

Change the order of the options of a radio switcher field (eg in /administrator/components/com_content/config.xml) and check how the switcher appears (in this example in the article manager options).

Expected result

imageimage

Actual result

imageimage

Documentation Changes Required

If there is a documentation on this switcher, it should be added that the order of the options is ignored.

avatar Bakual Bakual - open - 27 Jan 2020
avatar Bakual Bakual - change - 27 Jan 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 27 Jan 2020
Category Layout
avatar SharkyKZ
SharkyKZ - comment - 27 Jan 2020

Switcher is not limited to 0/1 or to integer values.

avatar Bakual
Bakual - comment - 27 Jan 2020

Hmm, is there a usecase where you would not have 0/1 values in a switcher?
After all the switcher only makes sense for "No/Yes" or "Hide/Show" type parameters.

But yeah, that would make this PR bad idea.

avatar brianteeman
brianteeman - comment - 27 Jan 2020

yes there are a lot of places where the values are not 0/1 currently

avatar Bakual
Bakual - comment - 27 Jan 2020

Ok, then we can close this. Was worth a shot ?

avatar Bakual Bakual - change - 27 Jan 2020
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2020-01-27 12:11:05
Closed_By Bakual
Labels Added: ?
avatar Bakual Bakual - close - 27 Jan 2020
avatar brianteeman
brianteeman - comment - 27 Jan 2020

For example the custom admin menu items
image

image

Add a Comment

Login with GitHub to post a comment