User tests: Successful: Unsuccessful:
Pull Request for Issue #26749.
In Global Configuration, 0/1
are saved as true/false
. Read #26749 (comment)
false
cast as string returns empty string and true
returns 1.
Assign it 0
so it can match the option value 0
.
<option value="0">JNO</option>
<option value="1">JYES</option>
Go to Global Configurations
See Site Offline missing label
Apply PR
Make sure switcher labels not missing
Open configuration.php
Toggle Site Offline
Make sure $offline
is saved as true or false
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Labels |
Added:
?
|
I have tested this item
Toggled Site Offline. configuration.php > public $offline=true;
I have tested this item
Working fine as per the mentioned "Testing instructions".
Status | Pending | ⇒ | Ready to Commit |
RTC.
Labels |
Added:
?
|
@HLeithner
is that OK for you?
I'm still not sure if this is the proper way to do this. But yeah if it's the best solution to resolve the problem. Shouldn't this be done in the model/formfield layer and not in the layout?
Forget my comment I mixed 2 pr's it seams to be ok.
In this specific case wondering if we actually should have this in the form. normally this is correct. However in the normal (non-switcher) radio field it may not be.
Changing this in the Jformfield would mean that this is valid for all abstracted classes, that means if I have a input field I get a '0' instead of an empty string correct? (if the function is not overridden)
I wouldn't expect this.
It is checking for a false
value. Empty string does not apply.
To test, apply PR. See Path to Cache Folder
field where it is empty. It does not display 0
.
thats true but if the value is false it would convert it also for a text field into '0' and not ''
It is a strict comparison for boolean and false. A string value will not be affected.
Title |
|
I am not at a computer to test but it should not be affected because it is string and not boolean.
Also this applies to the configuration file only when storing true/false values if I am not wrong. It has been a while since doing this PR. My memory not so good these days.
Works perfectly for me. I dont see any issues.
@Fedik please post exactly where it breaks
Works perfectly for me. I dont see any issues.
@Fedik please post exactly where it breaks
I have tested this item
I can't comment about the code but it solves the problem
please post exactly where it breaks
People tested it with switcher field, but this changes:
will affect every field
this may lead to unexpected behavior, when example some extension have a custom field,
which expect value to be boolean false
, and we force it to be string '0'
.
Status | Ready to Commit | ⇒ | Pending |
setting to pending
I do not have a specific example to demonstrate, it a logic assumption that comes from the code review.
If we need this hacky thing, then better to do it specifically for the switcher field, not global.
There a couple ways:
Or move this hacky code to the switcher layout itself layouts/joomla/form/field/radio/switcher.php
Or fix these two conditions to work correctly:
joomla-cms/layouts/joomla/form/field/radio/switcher.php
Lines 73 to 77 in a9f80d6
Labels |
Removed:
?
|
Category | Libraries | ⇒ | Layout |
Is this better?
much better
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-02-16 15:40:55 |
Closed_By | ⇒ | wilsonge |
I mean it's grim. But much better than the initial code change. So merging. Thankyou!
I have tested this item✅ successfully on f17349d
Toggled Site Offline. configuration.php > public $offline=true;
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27098.