? ? Pending

User tests: Successful: Unsuccessful:

avatar Fedik
Fedik
12 Jul 2020

Pull Request for Issue #29885
Redo of #30070

Summary of Changes

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.

Testing Instructions

  • Apply the patch.
  • Create a "btn-group" field, somewhere, example in Custom HTML module:
<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 - 12 Jul 2020
avatar Fedik Fedik - change - 12 Jul 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 12 Jul 2020
Category Layout
avatar degobbis degobbis - test_item - 12 Jul 2020 - Tested successfully
avatar degobbis
degobbis - comment - 12 Jul 2020

I have tested this item successfully on 747bb84


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

avatar richard67 richard67 - test_item - 12 Jul 2020 - Tested successfully
avatar richard67
richard67 - comment - 12 Jul 2020

I have tested this item successfully on 747bb84

Tested both the suggested code and the plugin from PR #29885 . Works both as expected.


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

avatar richard67
richard67 - comment - 12 Jul 2020

The Appveyor failure for PHP 5.6 is not related to this PR. It seems for this target the composer installation fails in general on the 3.10-dev branch. => @zero-24 @HLeithner @wilsonge Is it a know problem?

avatar richard67 richard67 - change - 12 Jul 2020
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 12 Jul 2020

RTC


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

avatar richard67 richard67 - change - 12 Jul 2020
Labels Added: ? ?
avatar richard67
richard67 - comment - 12 Jul 2020

@brianteeman Could you review this code comment here regarding proper English? Thanks in advance. https://github.com/joomla/joomla-cms/pull/30078/files#diff-3515fd3cec8ce68eb4b8ec2cbd518dcbR14

avatar Fedik Fedik - change - 12 Jul 2020
Labels
avatar richard67 richard67 - alter_testresult - 12 Jul 2020 - degobbis: Tested successfully
avatar richard67 richard67 - alter_testresult - 12 Jul 2020 - richard67: Tested successfully
avatar richard67
richard67 - comment - 12 Jul 2020

Previous tests and RTC status are still valid since last change was only in a code comment. Thanks @brianteeman for the review.

avatar richard67
richard67 - comment - 12 Jul 2020

As before: The Appveyor failure for PHP 5.6 is not related to this PR.

avatar zero-24
zero-24 - comment - 12 Jul 2020

Merging into 3.10 thanks :)

avatar zero-24 zero-24 - change - 12 Jul 2020
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-07-12 19:59:15
Closed_By zero-24
avatar zero-24 zero-24 - close - 12 Jul 2020
avatar zero-24 zero-24 - merge - 12 Jul 2020
avatar Fedik
Fedik - comment - 12 Jul 2020

And the note for @wilsonge : do not merge it to 4.0-dev ?

avatar zero-24
zero-24 - comment - 29 Sep 2020
avatar JoomliC
JoomliC - comment - 12 Oct 2021

@Fedik Not sure if it's "normal", but using list type instead of radio, and you get a list in versions prior to 3.10 (not the empty control) without the need of the switcher layout, and switcher as well on J4.
Maybe a way for developer who needs to support Joomla version prior to 3.10?

<field
	name="switchertest"
	type="list"
	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>
avatar Fedik
Fedik - comment - 12 Oct 2021

yes it "normal", however your usage is weird :)
list field in Joomla 3 does not support custom layout, and so this attribute is ignored.
In Joomla 4 list field support custom layout, and so it will render any layout that in layout attribute.

avatar JoomliC
JoomliC - comment - 12 Oct 2021

yes it "normal", however your usage is weird :)

I don't use it this way ;-)
But i was just wondering if a possible "hack" for some if needed...

Add a Comment

Login with GitHub to post a comment