Skip to content
Snippets Groups Projects
Commit 6a6fc642 authored by Christopher Gervais's avatar Christopher Gervais
Browse files

Issue #3164885: Fix enforcing dependencies.

parent 25c05f25
No related branches found
No related tags found
No related merge requests found
......@@ -377,7 +377,14 @@ trait DevelFormHelperTrait {
* Return array of config enforce values from the form.
*/
protected function getConfigEnforceValuesFromForm() {
return $this->formState()->getValue('config_enforce');
$values = $this->formState()->getValue('config_enforce');
// Some forms appear to wrap our settings in an array.
if (array_key_exists('config_enforce', $values)) {
$values = $values['config_enforce'];
}
return $values;
}
/**
......@@ -385,10 +392,6 @@ trait DevelFormHelperTrait {
*/
protected function getConfigEnforceValue(string $field) {
$values = $this->getConfigEnforceValuesFromForm();
if ($this->areConfigEnforceValuesWrapped()) {
// Some forms appear to wrap our settings in an array.
$values = $values['config_enforce'];
}
return $values[$this->getCurrentConfig()][$field];
}
......@@ -400,14 +403,6 @@ trait DevelFormHelperTrait {
return array_key_exists($field, $values[$this->getCurrentConfig()]);
}
/**
* Determine whether config enforce values are wrapped in an extra array.
*/
protected function areConfigEnforceValuesWrapped() {
$values = $this->getConfigEnforceValuesFromForm();
return array_key_exists('config_enforce', $values);
}
/**
* Return the new enabled setting from the form state.
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment