Add $disabledItems to check for disabled items instead of checking against $defaultItems

Fixes #8688
This commit is contained in:
Kong Jin Jie 2018-12-31 17:25:11 +08:00
parent b22af5303f
commit 1667af8f5e

View File

@ -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,