From 814b0ff3a04fe5e48004937cf7e92b062f6800db Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Thu, 7 Mar 2019 16:09:22 -0500 Subject: [PATCH] Client: Fix forward-validation failure messages Forward validation failures were never updated to use the new Failure object, so they ended up showing the default message. The problem was that `ui.invalidateForm' was replacing the Failure object with a new one with an empty message. This change just does the same thing as the change and save events. * src/client/Client.js (_forwardValidate): Invoke `#_genValidationMessages' and `_dataValidator.updateFailures'. Stop calling `ui.invalidateForm'. --- src/client/Client.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/client/Client.js b/src/client/Client.js index a030549..b510c43 100644 --- a/src/client/Client.js +++ b/src/client/Client.js @@ -2046,7 +2046,13 @@ module.exports = Class( 'Client' ) // just as we would with the `submit' event. if ( failures !== null ) { - this.ui.invalidateForm( failures ); + this._genValidationMessages( + this._validationMessages, + failures + ); + + this._dataValidator.updateFailures( {}, failures ); + return false; }