Skip to content

Commit 86d29e6

Browse files
authored
Revert "Don't filter form data on reload (#28103)"
This reverts commit ab67635.
1 parent a02140d commit 86d29e6

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

libraries/src/MVC/Controller/FormController.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -911,8 +911,20 @@ public function reload($key = null, $urlVar = null)
911911
false
912912
);
913913

914+
// Validate the posted data.
915+
// Sometimes the form needs some posted data, such as for plugins and modules.
916+
$form = $model->getForm($data, false);
917+
918+
if (!$form)
919+
{
920+
$app->enqueueMessage($model->getError(), 'error');
921+
922+
$this->setRedirect($redirectUrl);
923+
$this->redirect();
924+
}
925+
914926
// Save the data in the session.
915-
$app->setUserState($this->option . '.edit.' . $this->context . '.data', $data);
927+
$app->setUserState($this->option . '.edit.' . $this->context . '.data', $form->filter($data));
916928

917929
$this->setRedirect($redirectUrl);
918930
$this->redirect();

0 commit comments

Comments
 (0)