From 6bb24ef4cccf52d56ee5c8ef43c9365509075d8a Mon Sep 17 00:00:00 2001 From: RomanKis Date: Mon, 18 Mar 2019 11:39:46 +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 cbfc0dae90dda..831f11976fb2f 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 @@ -919,12 +919,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 a742b8e6bbb27..cd3d3bea4eabf 100644 --- a/lib/web/mage/validation.js +++ b/lib/web/mage/validation.js @@ -1425,10 +1425,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 0add8b722cb1591a3a2b8fe74e20d492431f5b18 Mon Sep 17 00:00:00 2001 From: RomanKis Date: Tue, 19 Mar 2019 09:50:14 +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 9c99a72c12d1c..6a432c1809ba5 100644 --- a/app/code/Magento/Catalog/etc/adminhtml/system.xml +++ b/app/code/Magento/Catalog/etc/adminhtml/system.xml @@ -56,7 +56,7 @@ Comma-separated. - validate-per-page-value-list + validate-per-page-value-list required-entry @@ -66,7 +66,7 @@ Comma-separated. - validate-per-page-value-list + validate-per-page-value-list required-entry