Commit fafcc123 authored by git's avatar git Committed by nikunj
Browse files

Issue #3072737 by Sergiu Stici, dlfaison: Warning: array_diff_key(): Argument...

Issue #3072737 by Sergiu Stici, dlfaison:  Warning: array_diff_key(): Argument #2 is not an array in Drupal\clientside_validation\Plugin\CvValidator\Required->getRules()  when I attempt to edit any node
parent 73e637b9
......@@ -37,7 +37,13 @@ class Required extends CvValidatorBase {
$is_required = $this->getAttributeValue($element, 'required');
$states = $this->getAttributeValue($element, 'states') ?: [];
$is_conditionally_required = array_diff_key($this->states, $states);
if (is_array($states)) {
$is_conditionally_required = array_diff_key($this->states, $states);
}
else {
$is_conditionally_required = $this->states;
}
// Drupal already adds the required attribute, so we don't need to set the
// required rule.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment