-
Bug
-
Resolution: Fixed
-
Neutral
-
4.4.2
-
None
We've added a custom ValidatingSaveHandler to the Page Info dialog for our pages.
Adding this has caused the original mandatory fields on the dialog, which were working beforehand, to become optional (despite still being marked with a *).
After some debugging, we've isolated the fault as follows:
The validate() method in DialogMVCHandler contains the following:
boolean passed = this.getDialog().validate(); SaveHandler saveHandler = this.getSaveHandler(); if (saveHandler instanceof ValidatingSaveHandler) { passed = ((ValidatingSaveHandler) saveHandler).validate(); }
As you can see, this ignores the results of dialog validation if a ValidatingSaveHandler is present.
We suggest changing this to:
boolean passed = this.getDialog().validate(); SaveHandler saveHandler = this.getSaveHandler(); if (saveHandler instanceof ValidatingSaveHandler) { passed = passed && ((ValidatingSaveHandler) saveHandler).validate(); }
We've worked around the problem at the momentby explicitly calling this.getDialog().validate() from our ValidatingSaveHandler, but this isn't really satisfactory.
Acceptance criteria