diff --git a/administrator/components/com_content/forms/article.xml b/administrator/components/com_content/forms/article.xml index 0684232883fe..fef4a86b2d6d 100644 --- a/administrator/components/com_content/forms/article.xml +++ b/administrator/components/com_content/forms/article.xml @@ -224,6 +224,7 @@ type="radio" label="JFEATURED" class="switcher" + required="true" default="0" > diff --git a/layouts/joomla/form/field/radio/switcher.php b/layouts/joomla/form/field/radio/switcher.php index 05f73c9219c4..b630f7fe0bfb 100644 --- a/layouts/joomla/form/field/radio/switcher.php +++ b/layouts/joomla/form/field/radio/switcher.php @@ -9,9 +9,9 @@ defined('JPATH_BASE') or die; -use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper; -extract($displayData); +extract($displayData, null); /** * Layout variables @@ -55,31 +55,51 @@ * %3 - value * %4 = any other attributes */ -$format = ''; -$alt = preg_replace('/[^a-zA-Z0-9_\-]/', '_', $name); +$input = ''; +$alt = preg_replace('/[^a-zA-Z0-9_\-]/', '_', $name); -?> - -
\ No newline at end of file + diff --git a/libraries/src/Form/FormField.php b/libraries/src/Form/FormField.php index 4ce7d5b10ce5..c7dd92429f9c 100644 --- a/libraries/src/Form/FormField.php +++ b/libraries/src/Form/FormField.php @@ -948,7 +948,7 @@ public function renderField($options = array()) $options['rel'] = ''; - if (empty($options['hiddenLabel']) && $this->getAttribute('hiddenLabel')) + if (empty($options['hiddenLabel']) && $this->getAttribute('hiddenLabel') || $this->class === 'switcher') { $options['hiddenLabel'] = true; }