? Pending

User tests: Successful: Unsuccessful:

avatar demis-palma
demis-palma
2 Feb 2018

The javascript code necessary for the radio buttons to work, has been duplicated and placed substantially unchanged among templates isis, protostar and beez3.

  1. administrator/templates/isis/js/template.js
  2. templates/protostar/js/template.js
  3. templates/beez3/javascript/template.js

The original code suffered a bug which prevents the OnChange JavaScript event to be thrown.
Over time, the 'change' event trigger has been added to isis version here by @bembelimen and to protostar version here by @Minei3oat and they hopefully can review and confirm this PR.

This PR ports the same fix to the beez3 template.

Summary of Changes

Testing Instructions

Put some HTML+JavaScript code to show the onchange event into an article. The following code is fine for that purpose.
Tip: Note that you need to use Editor:none as back-end editor to actually add the code, otherwise javascript code could be stripped out during article save.

<div class="controls">
	<fieldset id="jform_offline" class="btn-group btn-group-yesno btn-group-reversed radio">
		<input type="radio" id="jform_offline0" name="jform[offline]" value="1"/>
		<label for="jform_offline0">Yes </label>
		<input type="radio" id="jform_offline1" name="jform[offline]" value="0" checked="checked"/>
		<label for="jform_offline1">No </label>
	</fieldset>
</div>

<script>
	jQuery('input[type=radio][name="jform[offline]"]').change(function () {
		alert('The value has changed. New value: ' + this.value);
	});
</script>

Expected result

When I change the value to the radio button in the back-end, an alert should notify that the event has been raised.

Actual result

While it works as expected for protostar template, it doesn't on beez3 template.
On beez3 template when user clicks on the radio control (the cue ball) the change event is raised, but when the user clicks on the radio button label, the value changes without raising the onchange event.

avatar demis-palma demis-palma - open - 2 Feb 2018
avatar demis-palma demis-palma - change - 2 Feb 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 2 Feb 2018
Category JavaScript Front End Templates (site)
avatar Quy
Quy - comment - 2 Feb 2018

I have tested this item successfully on fcdb626


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

avatar Quy Quy - test_item - 2 Feb 2018 - Tested successfully
avatar Minei3oat Minei3oat - test_item - 26 Feb 2018 - Tested successfully
avatar Minei3oat
Minei3oat - comment - 26 Feb 2018

I have tested this item successfully on fcdb626

This Fix works, but it is not the best solution. As I tried to explain in #12029, the whole JavaScript-Code is useless, because Beez3 doesn't contains the needed CSS-Code. Removing the whole JavaScript-Code would solve the issue, too.


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

avatar franz-wohlkoenig franz-wohlkoenig - change - 27 Feb 2018
Status Pending Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 27 Feb 2018

Ready to Commit after two successful tests.

avatar demis-palma
demis-palma - comment - 27 Feb 2018

@Minei3oat I agree. But in my experience it's hard to convince the comunity to remove something, especially in a maintainence release. And they have a point. After all, who knows if any extension around the world relies on this (useless) feature?
So, a new major version would the best opportunity to remove this code. And infact the entire beez3 templates has been removed in Joomla 4, I guess.

avatar mbabker mbabker - change - 17 Mar 2018
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2018-03-17 15:14:38
Closed_By mbabker
Labels Added: ?
avatar mbabker mbabker - close - 17 Mar 2018
avatar mbabker mbabker - merge - 17 Mar 2018

Add a Comment

Login with GitHub to post a comment