Skip to content

Commit b3056e2

Browse files
author
Dominic Tubach
committed
ArrayArrayFactory: Set #limit_validation_errors to [] instead of TRUE
If `#limit_validation_errors` is not `FALSE` Drupal expects an array and tries to iterate over it. Using `TRUE` results in a PHP warning.
1 parent 521da17 commit b3056e2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Form/Control/ArrayArrayFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public function createFormArray(
113113
'#disabled' => NULL !== $definition->getMinItems() && $numItems <= $definition->getMinItems(),
114114
'#value' => $definition->getOptionsValue('removeButtonLabel', 'x'),
115115
'#name' => $definition->getFullScope() . '_remove_' . $i,
116-
'#limit_validation_errors' => TRUE,
116+
'#limit_validation_errors' => [],
117117
'#validate' => [ArrayCallbacks::class . '::removeItem'],
118118
'#submit' => [],
119119
'#ajax' => [
@@ -133,7 +133,7 @@ public function createFormArray(
133133
'#type' => 'button',
134134
'#disabled' => NULL !== $definition->getMaxItems() && $numItems >= $definition->getMaxItems(),
135135
'#value' => $definition->getOptionsValue('addButtonLabel', '+'),
136-
'#limit_validation_errors' => TRUE,
136+
'#limit_validation_errors' => [],
137137
'#validate' => [ArrayCallbacks::class . '::addItem'],
138138
'#submit' => [],
139139
'#ajax' => [

0 commit comments

Comments
 (0)