Skip to content

Commit

Permalink
Set custom element values to strings on error (fix #1691)
Browse files Browse the repository at this point in the history
These two elements are custom built in common/property-form-batch-edit.phtml
and will POST arrays. The form knows about the elements via hidden inputs,
which expect strings. If the form has an error, we must set the input values
to empty strings or there will be errors.
  • Loading branch information
jimsafley committed Aug 25, 2022
1 parent 682fe37 commit c26e1d3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions application/src/Controller/Admin/ItemController.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ public function batchEditAction()
$this->messenger()->addSuccess('Items successfully edited'); // @translate
return $this->redirect()->toRoute(null, ['action' => 'browse'], true);
} else {
$form->get('set_value_visibility')->setValue('');
$form->get('value')->setValue('');
$this->messenger()->addFormErrors($form);
}
}
Expand Down

0 comments on commit c26e1d3

Please sign in to comment.