Skip to content

Commit

Permalink
magento#21734 Error in JS validation rule
Browse files Browse the repository at this point in the history
kisroman authored and amol2jcommerce committed Mar 29, 2019
1 parent 49ca099 commit 2642230
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 3 additions & 3 deletions app/code/Magento/Ui/view/base/web/js/lib/validation/rules.js
Original file line number Diff line number Diff line change
@@ -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++) {
6 changes: 5 additions & 1 deletion lib/web/mage/validation.js
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit 2642230

Please sign in to comment.