RadioButton default value bug

More
11 years 3 months ago - 11 years 3 months ago #32281 by gruz
Here is how I set deafault value for a radiobutton:
[img


But if I set it to zero, it's not set:

[img


Here is the reason:
plugins/flexicontent_fields/radio/radio.php

Line 82
Code:
if (!$field->value && $default_value) {

But if we have zero in $default_value, then this IF is FALSE.

So my suggestion is here:
Code:
if (!$field->value && $default_value !== '') {

J2.5
FC - 2.0 - Rev 1612 (since 17-00 30.12.2012)
Last edit: 11 years 3 months ago by gruz.

Please Log in or Create an account to join the conversation.

More
11 years 3 months ago #32282 by ggppdk
Thanks for report,

this zero value as "default_value" bug exists in 6 fields , will commit fix for :

(single value fields): radio, radioimage, select
(multi value fields): checkbox, checkboximage, selectmultiple


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.265 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline