Skip to content

Commit 584564f

Browse files
author
Stanislav Idolov
authored
ENGCOM-3166: Fixed typo from heght to height for image validation rule #18540
2 parents aa93f28 + 605d5d9 commit 584564f

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

app/code/Magento/Customer/Model/Metadata/Form/Image.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ protected function _validateByRules($value)
133133

134134
$maxImageHeight = ArrayObjectSearch::getArrayElementByName(
135135
$rules,
136-
'max_image_heght'
136+
'max_image_height'
137137
);
138138
if ($maxImageHeight !== null) {
139139
if ($maxImageHeight < $imageProp[1]) {

app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/ImageTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ public function testValidateMaxImageHeight()
259259
)->getMockForAbstractClass();
260260
$validationRuleMock->expects($this->any())
261261
->method('getName')
262-
->willReturn('max_image_heght');
262+
->willReturn('max_image_height');
263263
$validationRuleMock->expects($this->any())
264264
->method('getValue')
265265
->willReturn($maxImageHeight);

app/code/Magento/Eav/Model/Attribute/Data/Image.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ protected function _validateByRules($value)
5454
$errors[] = __('"%1" width exceeds allowed value of %2 px.', $label, $r);
5555
}
5656
}
57-
if (!empty($rules['max_image_heght'])) {
58-
if ($rules['max_image_heght'] < $imageProp[1]) {
59-
$r = $rules['max_image_heght'];
57+
if (!empty($rules['max_image_height'])) {
58+
if ($rules['max_image_height'] < $imageProp[1]) {
59+
$r = $rules['max_image_height'];
6060
$errors[] = __('"%1" height exceeds allowed value of %2 px.', $label, $r);
6161
}
6262
}

app/code/Magento/Eav/Test/Unit/Model/Attribute/Data/ImageTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,23 +143,23 @@ public function validateValueDataProvider()
143143
'originalValue' => 'value',
144144
'isRequired' => true,
145145
'isAjaxRequest' => false,
146-
'rules' => ['max_image_heght' => 2],
146+
'rules' => ['max_image_height' => 2],
147147
'expectedResult' => ['"Label" height exceeds allowed value of 2 px.']
148148
],
149149
[
150150
'value' => ['delete' => 'delete', 'tmp_name' => __DIR__ . '/_files/image.jpg', 'name' => 'image.jpg'],
151151
'originalValue' => 'value',
152152
'isRequired' => true,
153153
'isAjaxRequest' => false,
154-
'rules' => ['max_image_heght' => 2000],
154+
'rules' => ['max_image_height' => 2000],
155155
'expectedResult' => true
156156
],
157157
[
158158
'value' => ['delete' => 'delete', 'tmp_name' => __DIR__ . '/_files/image.jpg', 'name' => 'image.jpg'],
159159
'originalValue' => 'value',
160160
'isRequired' => true,
161161
'isAjaxRequest' => false,
162-
'rules' => ['max_image_heght' => 2, 'max_image_width' => 2],
162+
'rules' => ['max_image_height' => 2, 'max_image_width' => 2],
163163
'expectedResult' => [
164164
'"Label" width exceeds allowed value of 2 px.',
165165
'"Label" height exceeds allowed value of 2 px.',

0 commit comments

Comments
 (0)