Skip to content

Commit 3ec14e7

Browse files
author
Stanislav Idolov
committed
ENGCOM-2793: [Forwardport] 6305 - Resolved product custom option title save issue #17607
1 parent c40f2ff commit 3ec14e7

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

app/code/Magento/Catalog/Model/Product/Option/Validator/DefaultValidator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ protected function isValidOptionTitle($title, $storeId)
107107
return true;
108108
}
109109

110-
// checking whether title is null and also changed is_empty to is_null
111-
if ($title === null) {
110+
// checking whether title is null and is empty string
111+
if ($title === null || $title === '') {
112112
return false;
113113
}
114114

dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductCustomOptionRepositoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public function testAddNegative($optionData)
208208
];
209209

210210
if (TESTS_WEB_API_ADAPTER == self::ADAPTER_SOAP) {
211-
if (isset($optionDataPost['title']) && empty($optionDataPost['title'])) {
211+
if ($optionDataPost['title'] === null || $optionDataPost['title'] === '') {
212212
$this->expectException('SoapFault');
213213
$this->expectExceptionMessage('Missed values for option required fields');
214214
} else {

dev/tests/api-functional/testsuite/Magento/Catalog/Api/_files/product_options_negative.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
return [
88
'empty_required_field' => [
9-
'title' => '',
9+
'title' => null,
1010
'type' => 'field',
1111
'sort_order' => 1,
1212
'is_require' => 1,
@@ -54,7 +54,7 @@
5454
'price' => 10.0,
5555
'price_type' => 'fixed',
5656
'sku' => 'radio option 1 sku',
57-
'title' => '',
57+
'title' => null,
5858
'sort_order' => 1,
5959
],
6060
],

0 commit comments

Comments
 (0)