From 8a63d4ca236e513c4ac5b43dc386b116390288e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=B5nis=20Ormisson?= Date: Wed, 12 Sep 2018 09:47:09 +0300 Subject: [PATCH] FIX: performAjaxValidation to return instgead echo --- controllers/AdminController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/AdminController.php b/controllers/AdminController.php index 06b4b8b1c..6a0eb5134 100644 --- a/controllers/AdminController.php +++ b/controllers/AdminController.php @@ -509,7 +509,7 @@ protected function performAjaxValidation($model) if (\Yii::$app->request->isAjax && !\Yii::$app->request->isPjax) { if ($model->load(\Yii::$app->request->post())) { \Yii::$app->response->format = Response::FORMAT_JSON; - echo json_encode(ActiveForm::validate($model)); + return json_encode(ActiveForm::validate($model)); \Yii::$app->end(); } }