Merge pull request #18707 from shariquerik/webform-validation-fix

This commit is contained in:
Shariq Ansari 2022-11-01 18:10:01 +05:30 committed by GitHub
commit 3bccc75620
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -347,11 +347,13 @@ export default class WebForm extends frappe.ui.FieldGroup {
save() {
let is_new = this.is_new;
if (this.validate && !this.validate()) {
frappe.throw(
let valid = this.validate && this.validate();
if (!valid && valid !== undefined) {
frappe.msgprint(
__("Couldn't save, please check the data you have entered"),
__("Validation Error")
);
return false;
}
// validation hack: get_values will check for missing data