? Pending

User tests: Successful: Unsuccessful:

avatar Fedik
Fedik
11 Jul 2020

Pull Request for Issue #29885

Summary of Changes

As for comment #29885 (comment)
The patch allows to transition from "btn-group" to "switcher" field more transparent.
The developer only need to add the layout attribute layout="joomla.form.field.radio.switcher" to the field xml.

I guess it has to be merged to 3.10 :)

Testing Instructions

Testing a bit tricky:

<field
	name="switchertest"
	type="radio"
	label="switcher test"
	class="btn-group btn-group-yesno"
	layout="joomla.form.field.radio.switcher"
	default="1"
>
	<option value="1">JYES</option>
	<option value="0">JNO</option>
</field>

Actual result BEFORE applying this Pull Request

The field are empty

Expected result AFTER applying this Pull Request

The field rendered as "btn-group"

Also try testing Instructions from #29885 pull.

Documentation Changes Required

I guess, maybe some explanation about transition to Joomla! 4

avatar Fedik Fedik - open - 11 Jul 2020
avatar Fedik Fedik - change - 11 Jul 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 11 Jul 2020
Category Layout Libraries
avatar Fedik Fedik - change - 11 Jul 2020
The description was changed
avatar Fedik Fedik - edited - 11 Jul 2020
avatar Fedik Fedik - change - 11 Jul 2020
Labels Added: ?
avatar Fedik Fedik - change - 11 Jul 2020
The description was changed
avatar Fedik Fedik - edited - 11 Jul 2020
avatar SharkyKZ
SharkyKZ - comment - 11 Jul 2020

Don't need the version thing in this case. You can just add joomla.form.field.radio.switcher layout and load joomla.form.field.radio layout inside it.

avatar Fedik
Fedik - comment - 11 Jul 2020

hm, that also true, I did not thought about ?
will see, what others will say

avatar HLeithner
HLeithner - comment - 11 Jul 2020

Don't need the version thing in this case. You can just add joomla.form.field.radio.switcher layout and load joomla.form.field.radio layout inside it.

That's the point you can't if you want to support j3 and j4 if I understand the original problem correct.

avatar SharkyKZ
SharkyKZ - comment - 11 Jul 2020

It works. Just need to make sure the new layout from J3 doesn't get merged into 4.0.

avatar HLeithner
HLeithner - comment - 11 Jul 2020

Maybe I miss something but how should this work?
In j3 we have a file called layouts/joomla/form/field/radio.php
In j4 we have a file called layouts/joomla/form/field/radiobasic.php and a directory layouts/joomla/form/field/radio/ with 2 files buttons.php and switcher.php

When you set joomla.form.field.radio.switcher in j3 it can't find the layout right?
When you set joomla.form.field.radio in j4 it can't find the layout right?

avatar HLeithner
HLeithner - comment - 11 Jul 2020

Or do you suggest to create the radio/switcher.php in 3.10.0?

avatar Fedik
Fedik - comment - 11 Jul 2020

@HLeithner the layout file joomla.form.field.radio.switcher (from Joomla 3) should not be merged to Joomla 4 branch.
Then while upgrade Joomla 3 joomla.form.field.radio.switcher file will be overridden by file from Joomla 4.
So Joomla 4 will use own joomla.form.field.radio.switcher.
That what @SharkyKZ meant

Or do you suggest to create the radio/switcher.php in 3.10.0?

yeap

avatar HLeithner
HLeithner - comment - 11 Jul 2020

Would make more sense. can you make a pr against 3.10?

avatar Fedik
Fedik - comment - 12 Jul 2020

redo for 3.10 #30078

avatar Fedik Fedik - close - 12 Jul 2020
avatar Fedik Fedik - change - 12 Jul 2020
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2020-07-12 08:53:43
Closed_By Fedik

Add a Comment

Login with GitHub to post a comment