mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
BUGFIX: throws an exception when readonly or/and default properties are not set to true
This commit is contained in:
parent
0492ab7955
commit
084d20b739
@ -66,9 +66,13 @@ class EditableCheckboxOption extends DataObject {
|
||||
function DefaultSelect() {
|
||||
if( $this->readonly )
|
||||
$disabled = " disabled=\"disabled\"";
|
||||
else
|
||||
$disabled = '';
|
||||
|
||||
if( $this->getField('Default') )
|
||||
$default = " checked=\"checked\"";
|
||||
else
|
||||
$default = '';
|
||||
|
||||
return "<input class=\"checkbox\" type=\"checkbox\" name=\"Fields[{$this->ParentID}][{$this->ID}][Default]\" value=\"1\"".$disabled.$default." />";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user