File tree 1 file changed +11
-5
lines changed
1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -606,7 +606,7 @@ window.PodsDFV = {
606
606
* @param {int|null } itemId Object ID. (Optional.)
607
607
* @param {int|null } formCounter Form index. (Optional.)
608
608
*
609
- * @return {string[]|undefined } List of validation messages, or undefined if not found .
609
+ * @return {Object.< string, string[]> } Returns field names as keys and arrays of validation messages as values .
610
610
*/
611
611
getValidationMessages ( pod = null , itemId = null , formCounter = null ) {
612
612
const form = this . detectForm (
@@ -625,9 +625,6 @@ window.PodsDFV = {
625
625
// Get validation messages.
626
626
const validationMessages = form . stored . getValidationMessages ( ) ;
627
627
628
- // Debug output for validation messages for now. @todo Remove this.
629
- console . log ( { validationMessages } ) ;
630
-
631
628
return validationMessages ;
632
629
} ,
633
630
@@ -647,7 +644,16 @@ window.PodsDFV = {
647
644
return undefined ;
648
645
}
649
646
650
- return 0 === validationMessages . length ;
647
+ if ( 0 === Object . keys ( validationMessages ) . length ) {
648
+ return false ;
649
+ }
650
+
651
+ return Object . values ( validationMessages ) . every ( ( messages ) => {
652
+ if ( 0 !== messages . length ) {
653
+ return false ;
654
+ }
655
+ return true ;
656
+ } ) ;
651
657
} ,
652
658
653
659
/**
You can’t perform that action at this time.
0 commit comments