Skip to content

Commit 4b281da

Browse files
author
Sergey Shvets
committed
MAGETWO-82132: Comma special character in cart price rule condition value results in incorrect rule
1 parent 4fa922f commit 4b281da

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

app/code/Magento/Ui/DataProvider/EavValidationRules.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ protected function aggregateRules(array $validations): array
7171
*/
7272
private function clipLengthRules(array $rules): array
7373
{
74-
if (empty($validateRules['input_validation'])) {
74+
if (empty($rules['input_validation'])) {
7575
unset(
7676
$rules['min_text_length'],
7777
$rules['max_text_length']

app/code/Magento/Ui/Test/Unit/DataProvider/EavValidationRulesTest.php

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
67
namespace Magento\Ui\Test\Unit\DataProvider;
78

89
use Magento\Eav\Model\Entity\Attribute\AbstractAttribute;
@@ -70,11 +71,25 @@ public function buildDataProvider()
7071
['', ['input_validation' => 'email'], [], ['validate-email' => true]],
7172
['', ['input_validation' => 'date'], [], ['validate-date' => true]],
7273
['', ['input_validation' => 'other'], [], []],
73-
['', ['max_text_length' => '254'], ['required' => 1], ['max_text_length' => 254, 'required-entry' => true]],
74-
['', ['max_text_length' => '254', 'min_text_length' => 1], [],
75-
['max_text_length' => 254, 'min_text_length' => 1]],
76-
['', ['max_text_length' => '254', 'input_validation' => 'date'], [],
77-
['max_text_length' => 254, 'validate-date' => true]],
74+
['', ['max_text_length' => '254'], ['required' => 1], ['required-entry' => true]],
75+
[
76+
'',
77+
['input_validation' => 'other', 'max_text_length' => '254'],
78+
['required' => 1],
79+
['max_text_length' => 254, 'required-entry' => true]
80+
],
81+
[
82+
'',
83+
['input_validation' => 'other', 'max_text_length' => '254', 'min_text_length' => 1],
84+
[],
85+
['max_text_length' => 254, 'min_text_length' => 1]
86+
],
87+
[
88+
'',
89+
['max_text_length' => '254', 'input_validation' => 'date'],
90+
[],
91+
['max_text_length' => 254, 'validate-date' => true]
92+
],
7893
];
7994
}
8095
}

0 commit comments

Comments
 (0)