From d22e23d78cb525dcb838bb90b365bd4907821710 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 9 Jun 2017 14:56:53 +0200 Subject: [PATCH] Expose the real validation exception message via Ajax See #2299 --- .../files/lib/action/AJAXInvokeAction.class.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/wcfsetup/install/files/lib/action/AJAXInvokeAction.class.php b/wcfsetup/install/files/lib/action/AJAXInvokeAction.class.php index 1534fa9540..5458bc1c70 100644 --- a/wcfsetup/install/files/lib/action/AJAXInvokeAction.class.php +++ b/wcfsetup/install/files/lib/action/AJAXInvokeAction.class.php @@ -35,7 +35,7 @@ class AJAXInvokeAction extends AbstractSecureAction { * action object * @var SingletonFactory */ - public $actionObject = null; + public $actionObject; /** * class name @@ -53,7 +53,7 @@ class AJAXInvokeAction extends AbstractSecureAction { * results of the executed action * @var mixed */ - protected $response = null; + protected $response; /** * @inheritDoc @@ -189,13 +189,15 @@ class AJAXInvokeAction extends AbstractSecureAction { throw new AJAXException($exception->getMessage(), AJAXException::BAD_PARAMETERS, $e->getTraceAsString(), [ 'errorMessage' => $exception->getMessage(), 'errorType' => $e->getType(), - 'fieldName' => $exception->getFieldName() + 'fieldName' => $exception->getFieldName(), + 'realErrorMessage' => $exception->getErrorMessage() ]); } else if ($e instanceof ValidateActionException) { throw new AJAXException($e->getMessage(), AJAXException::BAD_PARAMETERS, $e->getTraceAsString(), [ 'errorMessage' => $e->getMessage(), - 'fieldName' => $e->getFieldName() + 'fieldName' => $e->getFieldName(), + 'realErrorMessage' => $e->getErrorMessage() ]); } else if ($e instanceof NamedUserException) { -- 2.20.1