Labels |
Added:
?
|
@Quy
Could you test modifying
https://github.com/joomla/joomla-cms/blob/4.0-dev/layouts/joomla/form/field/radio/switcher.php#L72-L73
by changing string to int, from
$checked = ((string) $option->value == $value) ? 'checked="checked"' : '';
$active = ((string) $option->value == $value) ? 'class="active"' : '';
to
$checked = ((int) $option->value == $value) ? 'checked="checked"' : '';
$active = ((int) $option->value == $value) ? 'class="active"' : '';
If judged necessary we could check if the $option->value
is numeric and use
// Initialize some option attributes.
if (is_numeric($option->value))
{
$checked = ((int) $option->value == $value) ? 'checked="checked"' : '';
$active = ((int) $option->value == $value) ? 'class="active"' : '';
}
else
{
$checked = ((string) $option->value == $value) ? 'checked="checked"' : '';
$active = ((string) $option->value == $value) ? 'class="active"' : '';
}
tested your #26749 (comment) and works, not sure we need the IF
but i let guru's to judge
Only in Global Configuration
, 0
and 1
are saved as false
and true
.
Compare configuration.php
with \installation\configuration.php-dist
to see that this is the case. See $offline
for example.
Let's fix the source of the issue, then your fix might not be necessary.
The problem won't go away because of updates. Best to make it work with both
In J3, these values are 0
and 1
. Only in J4, that they are saved as true
and false
.
4.0 uses proper types for most params, 3.x doesn’t (part of it is the Registry package was changed to dump data as proper scalars instead of always a string when dumping as a PHP file, which impacts generating configuration.php). So, for the 4.x lifetime, most param checks continue to need to not be strict or to typecast the data being read.
It would be good to have some tool that could bulk resave all params with proper types, but that might be a little too complex to pull off anytime soon (because to fix it otherwise pretty much requires a user to resave every configuration at every level).
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-11-02 07:21:48 |
Closed_By | ⇒ | infograf768 |
I confirm the issue. One has to first use the switch on and off to get the
No
orHide
label.