J4 Issue ?
avatar astridx
astridx
24 Jun 2018

Steps to reproduce the issue

Open global configuration and see outer html of the field "Search Engine Friendly URLs"


<joomla-field-switcher id="jform_sef" off-text="No" on-text="Yes" type="success">
<span class="switcher active has-success" tabindex="0" aria-checked="true" role="switch" aria-label="Yes"><input id="jform_sef0" name="jform[sef]" value="0" tabindex="-1" class="valid form-control-success" aria-invalid="false" type="radio"><input id="jform_sef1" name="jform[sef]" value="1" class="valid active form-control-success" tabindex="-1" checked="" aria-invalid="false" type="radio"><span class="switch"></span></span><span class="switcher-labels"><span class="switcher-label-0">No</span><span class="switcher-label-1 active">Yes</span></span></joomla-field-switcher>

Open /administrator/components/com_config/forms/application.xml

and change the field (insert onclick and onchange`)

		<field
			name="sef"
			type="radio"
			label="COM_CONFIG_FIELD_SEF_URL_LABEL"
			class="switcher"
			default="1"
			filter="boolean"
			>
			<option value="0">JNO</option>
			<option value="1">JYES</option>
		</field>

to

		<field
			name="sef"
			type="radio"
			label="COM_CONFIG_FIELD_SEF_URL_LABEL"
			class="switcher"
			default="1"
			filter="boolean"
			onclick="MyOnclickEvent"
			onchange="MyOnchangeEvent"
			>
			<option value="0">JNO</option>
			<option value="1">JYES</option>
		</field>

Open again global configuration and see outer html of the field "Search Engine Friendly URLs". Nothing is added.

Expected result

Onclick event and Onchange event are added to the field "Search Engine Friendly URLs".

Actual result

Nothing changed.

System information (as much as possible)

Current 4.0-dev branch on ubuntu

Additional comments

In the layout file
/layouts/joomla/form/field/radio/switcher.php
onclick and onchange are added from option. But the value is a separet variable. Pheraps this is the problem?

avatar astridx astridx - open - 24 Jun 2018
avatar joomla-cms-bot joomla-cms-bot - change - 24 Jun 2018
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 24 Jun 2018
avatar franz-wohlkoenig franz-wohlkoenig - change - 24 Jun 2018
Category Administration
avatar franz-wohlkoenig franz-wohlkoenig - change - 24 Jun 2018
Status New Discussion
avatar brianteeman brianteeman - change - 25 Jun 2018
Labels Added: J4 Issue
avatar brianteeman brianteeman - labeled - 25 Jun 2018
avatar franz-wohlkoenig franz-wohlkoenig - change - 29 Jun 2018
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2018-06-29 14:01:08
Closed_By franz-wohlkoenig
avatar joomla-cms-bot
joomla-cms-bot - comment - 29 Jun 2018
avatar joomla-cms-bot joomla-cms-bot - change - 29 Jun 2018
Closed_Date 2018-06-29 14:01:08 2018-06-29 14:01:10
Closed_By franz-wohlkoenig joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 29 Jun 2018
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 29 Jun 2018

closed as having Pull Request #20931

avatar richard67
richard67 - comment - 23 Dec 2019

@astridx It seems this issue is back on current 4.0-dev, i.e. the change from backend template either got not merged into the CMS or was lost again later. Shall I reopen this issue for you, or do you want to reopen it, or do you want to make a new one?

P.S.: Maybe that comes from #24463 ?

P.P.S: Issue should be only for onchange, not for onclick, because I don't see that we support onclick for the other fields.

avatar astridx
astridx - comment - 23 Dec 2019

I can only comment on the issue. I don't see a button to reopen.

If you are sure that the issue is back, please open it.

I will not be able to take a closer look at this the next two weeks. If someone else likes, that would be great.

avatar richard67
richard67 - comment - 23 Dec 2019

@astridx I think I will open a new issue and/or maybe a new PR if I find the solution soon. I wish you a merry x-mas.

avatar richard67
richard67 - comment - 27 Dec 2019

@astridx New PR is #27355 . I didn't add onclick, only onchange, because click on a switcher always means change and because we also don't have onclick for a list field. Wish me good luck with getting testers ;-)

Add a Comment

Login with GitHub to post a comment