1
0
Fork 0

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'.
master
Mike Gerwitz 2019-03-07 16:09:22 -05:00
parent 53078919bb
commit 814b0ff3a0
1 changed files with 7 additions and 1 deletions

View File

@ -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;
}