From c8ed1e8ce498174df804b578665a5bcfd4c9e850 Mon Sep 17 00:00:00 2001 From: RomanKis Date: Fri, 15 Mar 2019 18:21:11 +0200 Subject: [PATCH 1/2] #21734 Error in JS validation rule --- .../Magento/Ui/view/base/web/js/lib/validation/rules.js | 6 +++--- lib/web/mage/validation.js | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Ui/view/base/web/js/lib/validation/rules.js b/app/code/Magento/Ui/view/base/web/js/lib/validation/rules.js index d765f842a0895..97b47f77beeab 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/validation/rules.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/validation/rules.js @@ -920,12 +920,12 @@ define([ ], 'validate-per-page-value-list': [ function (value) { - var isValid = utils.isEmpty(value), + var isValid = true, values = value.split(','), i; - if (isValid) { - return true; + if (utils.isEmpty(value)) { + return isValid; } for (i = 0; i < values.length; i++) { diff --git a/lib/web/mage/validation.js b/lib/web/mage/validation.js index dfa35473176b9..a57191fd4aff4 100644 --- a/lib/web/mage/validation.js +++ b/lib/web/mage/validation.js @@ -1431,10 +1431,14 @@ ], 'validate-per-page-value-list': [ function (v) { - var isValid = !$.mage.isEmpty(v), + var isValid = true, values = v.split(','), i; + if ($.mage.isEmpty(v)) { + return isValid; + } + for (i = 0; i < values.length; i++) { if (!/^[0-9]+$/.test(values[i])) { isValid = false; From b030da0d92eeb455b03059807b66a9de29d2a1bf Mon Sep 17 00:00:00 2001 From: RomanKis Date: Tue, 19 Mar 2019 09:48:02 +0200 Subject: [PATCH 2/2] #21734 Error in JS validation rule --- app/code/Magento/Catalog/etc/adminhtml/system.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Catalog/etc/adminhtml/system.xml b/app/code/Magento/Catalog/etc/adminhtml/system.xml index 7a05601fcd666..1d563244f1432 100644 --- a/app/code/Magento/Catalog/etc/adminhtml/system.xml +++ b/app/code/Magento/Catalog/etc/adminhtml/system.xml @@ -59,7 +59,7 @@ Comma-separated. - validate-per-page-value-list + validate-per-page-value-list required-entry @@ -69,7 +69,7 @@ Comma-separated. - validate-per-page-value-list + validate-per-page-value-list required-entry