? ? Success

User tests: Successful: Unsuccessful:

avatar brianteeman
brianteeman
7 Sep 2019

Removal of the extra class (not present in the css) that breaks the switcher code and results in a double label.

Before

image

After

image

Any decision about changing switcher like this which might be deemed to not be true boolean is beyond the scope of this PR

c391324 7 Sep 2019 avatar brianteeman more
avatar brianteeman brianteeman - open - 7 Sep 2019
avatar brianteeman brianteeman - change - 7 Sep 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 7 Sep 2019
Category com_tags Administration com_templates Front End com_users Templates (site)
avatar SharkyKZ
SharkyKZ - comment - 8 Sep 2019

Given that switcher-primary class doesn't exist this PR is fine. But it doesn't solve the root cause. For some reason known only to @dgrammatiko radio field is using class attribute to select a layout instead of using the layout attribute.

avatar SharkyKZ SharkyKZ - test_item - 8 Sep 2019 - Tested successfully
avatar SharkyKZ
SharkyKZ - comment - 8 Sep 2019

I have tested this item successfully on c391324


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

avatar brianteeman
brianteeman - comment - 8 Sep 2019

@SharkyKZ please raise that as its own issue

avatar dgrammatiko
dgrammatiko - comment - 8 Sep 2019

@SharkyKZ I think you should tag @C-Lodder not me for the switcher

avatar SharkyKZ
SharkyKZ - comment - 8 Sep 2019

@dgrammatiko No, it's coming from #19296. Anyways, here's PR #26214 to remove class-based logic.

avatar C-Lodder
C-Lodder - comment - 8 Sep 2019

Wasn't the switch rewritten to drop the custom element?

avatar brianteeman
brianteeman - comment - 8 Sep 2019

Yes and its nothing to do with this PR

avatar wilsonge wilsonge - change - 9 Sep 2019
Labels Added: ?
avatar wilsonge
wilsonge - comment - 9 Sep 2019

OK if the extra class here doesn't exist why are we getting the double label (this "fix" is clearly not wrong - but suggests there might also be a css issue in the switcher field we need to fix if extra classes are causing styling issues that is being revealed here).

avatar dgrammatiko
dgrammatiko - comment - 9 Sep 2019

@wilsonge hint: check the regex that switches the field behaviour

avatar SharkyKZ
SharkyKZ - comment - 9 Sep 2019

It's coming from here:

if (empty($options['hiddenLabel']) && $this->getAttribute('hiddenLabel') || $this->class === 'switcher')

Why is switcher-specific code included in this class is beyond me. I proposed to remove this along with class-based layout assignment.

avatar dgrammatiko
dgrammatiko - comment - 9 Sep 2019

Why is switcher-specific code included in this class is beyond me.

Because it has it's own label

avatar SharkyKZ
SharkyKZ - comment - 9 Sep 2019

@dgrammatiko That doesn't explain why something specific to Joomla\CMS\Form\Field\RadioField is handled in Joomla\CMS\Form\FormField.

avatar dgrammatiko
dgrammatiko - comment - 9 Sep 2019

@SharkyKZ I will agree, this leak in the parent class is unacceptable. FWIW this new css-only implementation has few more flaws, one is that it broke the layouts comparison but most importantly the fact that it doesn't provide any meaningful API for DEVs to use it (meaning you have to implement your own logic)
But hey, it is javascript free...

avatar brianteeman
brianteeman - comment - 9 Sep 2019

If only it had been tested

avatar dgrammatiko
dgrammatiko - comment - 9 Sep 2019
avatar C-Lodder
C-Lodder - comment - 9 Sep 2019

If I rightly remember, the logic was in the layout when I first added the switcher. From then on, I did not follow the code changes, so I'm the wrong person to be tagging in this

avatar dgrammatiko
dgrammatiko - comment - 9 Sep 2019

FWIW @SharkyKZ wrongly blames me for this code as it was there before #19296 as anyone can see:
https://github.com/joomla/joomla-cms/pull/19296/files#diff-5672706c28da6ae7d160c2c45b37d279L57

All I did in #19296 was to separate the layouts, the logic for the class was already there...

I'm happy to take the blame on any of the code I introduced but it's unfair to take the blame for other peoples code

avatar brianteeman
brianteeman - comment - 9 Sep 2019

All of these comments are interesting but completely off topic. This PR is about removing a class that does not exist and whose presence is breaking the layout. Anything else should be dealt with in its own issue

avatar dgrammatiko
dgrammatiko - comment - 9 Sep 2019

but completely off topic

Sorry , no, @SharkyKZ is right the root of this bug is that If statement which expects only ONE class named switcher. The extra classes you are removing in this PR is a bandaid not a proper solution

avatar brianteeman
brianteeman - comment - 9 Sep 2019

and that can be looked at in its own pull request. removing the extra unused class will have to be removed anyway

avatar wilsonge
wilsonge - comment - 28 Sep 2019

Structural fix here #26423

Once that is merged then we should remove the redundant classes here (leaving them in until that is merged allows easy testing)

avatar pravinTek pravinTek - test_item - 19 Oct 2019 - Tested successfully
avatar pravinTek
pravinTek - comment - 19 Oct 2019

I have tested this item successfully on 7902fe5


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

avatar tushar33 tushar33 - test_item - 19 Oct 2019 - Tested successfully
avatar tushar33
tushar33 - comment - 19 Oct 2019

I have tested this item successfully on 7902fe5


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

avatar SharkyKZ SharkyKZ - change - 19 Oct 2019
Status Pending Ready to Commit
avatar SharkyKZ
SharkyKZ - comment - 19 Oct 2019

RTC


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

avatar wilsonge wilsonge - change - 19 Oct 2019
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2019-10-19 14:21:59
Closed_By wilsonge
Labels Added: ?
avatar wilsonge
wilsonge - comment - 19 Oct 2019

Thanks!

avatar brianteeman
brianteeman - comment - 19 Oct 2019

Thanks

Add a Comment

Login with GitHub to post a comment