From: Alexander Ebert Date: Fri, 9 Jun 2017 12:56:53 +0000 (+0200) Subject: Expose the real validation exception message via Ajax X-Git-Tag: 3.1.0_Alpha_1~389 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d22e23d78cb525dcb838bb90b365bd4907821710;p=GitHub%2FWoltLab%2FWCF.git Expose the real validation exception message via Ajax See #2299 --- 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) {