mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Add $disabledItems to check for disabled items instead of checking against $defaultItems
Fixes #8688
This commit is contained in:
parent
b22af5303f
commit
1667af8f5e
@ -72,6 +72,7 @@ class CheckboxSetField extends MultiSelectField
|
||||
{
|
||||
$selectedValues = $this->getValueArray();
|
||||
$defaultItems = $this->getDefaultItems();
|
||||
$disabledItems = $this->getDisabledItems();
|
||||
|
||||
// Generate list of options to display
|
||||
$odd = false;
|
||||
@ -84,7 +85,7 @@ class CheckboxSetField extends MultiSelectField
|
||||
$extraClass .= ' val' . preg_replace('/[^a-zA-Z0-9\-\_]/', '_', $itemValue);
|
||||
|
||||
$itemChecked = in_array($itemValue, $selectedValues) || in_array($itemValue, $defaultItems);
|
||||
$itemDisabled = $this->isDisabled() || in_array($itemValue, $defaultItems);
|
||||
$itemDisabled = $this->isDisabled() || in_array($itemValue, $disabledItems);
|
||||
|
||||
$options->push(new ArrayData(array(
|
||||
'ID' => $itemID,
|
||||
|
Loading…
Reference in New Issue
Block a user