New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug-in-checkbox #1252
Comments
any news about this ? |
I'm not convinced there's a problem. See thread for my response. |
The "Defaults" tooltipps are saying "Data to record if no checkbox is ticked"/"Text shown in table view if..." I can see the mismatch in the definition to a standard element "Default". |
Hmmm. I'm not sure why the tool tip says that. Afaik, the checkbox has It's possible that the tool tip was copied from the radio button, as they So, I guess we have to decide whether to change the behaviour, or the tool
|
Behaviour is the same in Fabrik3.2. |
My bad, I was thinking about the specific checkbox defaults. OK, yeah ... I'll fix that. |
Turns out it's not quite as simple as just tweaking that line in getEmptyDataValue(). Its going to take some changes where that method gets called, in onStoreRow():
That commented out line is what's there at the moment, which means getEmptyDataValue() won't even get called if the key exists. The replacement is what I'm testing, but it isn't what is needed either. I had to move on to something else, but I'll try and get back to this soon. |
Oh, and just for my own notes ... even if we call getEmptyData(), it'll need to be tweaked to NOT set the _raw value in that context, because the $data we are setting up in onStoreRow() is what gets used for the actual insert/update query, and should only conatin valid field names ... which the _raw isn't. |
http://www.fabrikar.com/forums/index.php?threads/bug-in-checkbox.38663/
array_key_exists($element->name, $data) does exist in case of "no checkbox checked"
["checkbox"]=> string(0) ""
["checkbox_raw"]=> NULL
so I think line 119 checkbox.php has to be
if (!array_key_exists($element->name, $data)||$data[$element->name]=="")
This is working but I'm not sure about
$data[$element->name] = $params->get('sub_default_value');
$data[$element->name . '_raw'] = array($params->get('sub_default_value'));
why without/with array?
The text was updated successfully, but these errors were encountered: