Merge pull request #8689 from jinjie/fix-checkbox-disabled-items

Fix for CheckboxSetField not disabling items correctly
This commit is contained in:
Robbie Averill 2019-01-07 09:25:34 +00:00 committed by GitHub
commit 7cb8256fa0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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,