Skip to content

Commit 474946c

Browse files
committed
6305 Resolved product custom option title save issue
1 parent 714d31c commit 474946c

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ protected function isValidOptionTitle($title, $storeId)
106106
if ($storeId > \Magento\Store\Model\Store::DEFAULT_STORE_ID && $title === null) {
107107
return true;
108108
}
109-
if ($this->isEmpty($title)) {
109+
110+
// checking whether title is null and also changed is_empty to is_null
111+
if ($this->isNull($title)) {
110112
return false;
111113
}
112114

@@ -168,4 +170,15 @@ protected function isNegative($value)
168170
{
169171
return intval($value) < 0;
170172
}
173+
174+
/**
175+
* check whether title is null
176+
*
177+
* @param $title
178+
* @return bool
179+
*/
180+
protected function isNull($title)
181+
{
182+
return is_null($title);
183+
}
171184
}

app/code/Magento/Catalog/Model/ResourceModel/Product/Option/Value.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,8 @@ protected function _saveValueTitles(AbstractModel $object)
256256
$object->unsetData('title');
257257
}
258258

259-
if ($object->getTitle()) {
259+
/*** Checking whether title is not null ***/
260+
if ($object->getTitle()!= null) {
260261
if ($existInCurrentStore) {
261262
if ($storeId == $object->getStoreId()) {
262263
$where = [

0 commit comments

Comments
 (0)