Skip to content

Commit dbf6d0e

Browse files
authored
Merge pull request #107 from systopia/clear-errors-on-recalculate-call
Clear errors on re-calculate call
2 parents 2f8e71a + 9c7e322 commit dbf6d0e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Form/Control/Callbacks/RecalculateCallback.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ final class RecalculateCallback {
3232
* sill can perform recalculation.
3333
*/
3434
public static function addAjaxCommands(AjaxResponse $response, FormStateInterface $formState): void {
35+
// Even though the triggering element has #limit_validation_errors set to []
36+
// form state might contain errors, e.g. if a no radio button of a required
37+
// radios element was selected.
38+
$formState->clearErrors();
3539
/** @var \Drupal\json_forms\Form\AbstractJsonFormsForm $formObject */
3640
$formObject = $formState->getFormObject();
3741
$newData = FieldNameUtil::toFormData($formObject->calculateData($formState));

0 commit comments

Comments
 (0)