From e402fe051f65aa52d4a1c1edc177330cc842d31b Mon Sep 17 00:00:00 2001 From: Asturyan Date: Fri, 21 Mar 2014 09:22:25 +0100 Subject: [PATCH] Fix "Undefined variable: ex" --- .../Admin/AbstractSeoCrudController.php | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/core/lib/Thelia/Controller/Admin/AbstractSeoCrudController.php b/core/lib/Thelia/Controller/Admin/AbstractSeoCrudController.php index db7e853db..2735ce176 100644 --- a/core/lib/Thelia/Controller/Admin/AbstractSeoCrudController.php +++ b/core/lib/Thelia/Controller/Admin/AbstractSeoCrudController.php @@ -168,7 +168,6 @@ abstract class AbstractSeoCrudController extends AbstractCrudController // Error (Default: false) $error_msg = false; - $ex = new \Exception(); // Create the Form from the request $updateSeoForm = $this->getUpdateSeoForm($this->getRequest()); @@ -222,15 +221,17 @@ abstract class AbstractSeoCrudController extends AbstractCrudController // Pass it to the parser $this->getParserContext()->addForm($changeForm); } - - $this->setupFormErrorContext( - $this->getTranslator()->trans("%obj SEO modification", array('%obj' => $this->objectName)), - $error_msg, - $updateSeoForm, - $ex - ); - - // At this point, the form has errors, and should be redisplayed. - return $this->renderEditionTemplate(); + + if (false !=== $error_msg) { + $this->setupFormErrorContext( + $this->getTranslator()->trans("%obj SEO modification", array('%obj' => $this->objectName)), + $error_msg, + $updateSeoForm, + $ex + ); + + // At this point, the form has errors, and should be redisplayed. + return $this->renderEditionTemplate(); + } } }