From 82e72d062f99880c0b3dc74cf8c3384c430d4afd Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Mon, 19 Sep 2016 16:46:59 +1200 Subject: [PATCH] BUG prevent form data / validation persisting in state when using form schema --- admin/code/LeftAndMain.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/admin/code/LeftAndMain.php b/admin/code/LeftAndMain.php index 27539e2fd..51891a46c 100644 --- a/admin/code/LeftAndMain.php +++ b/admin/code/LeftAndMain.php @@ -341,6 +341,10 @@ class LeftAndMain extends Controller implements PermissionProvider { $data = $this->getSchemaForForm($form); $response = new HTTPResponse(Convert::raw2json($data)); $response->addHeader('Content-Type', 'application/json'); + + // Clear non-schema form validation / data / message + // since it does not need to be redirected + $form->clearMessage(); return $response; } return null;