Skip to content

Commit 09715bb

Browse files
committed
ACP2E-2927: [REST API]: Use Default value in store view does not stay checked after adding configurations for a configurable product
1 parent c5e249e commit 09715bb

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ private function overwriteValue($optionId, $option, $overwriteOptions)
402402
$option['is_delete_store_title'] = 1;
403403
}
404404
}
405-
if (CustomOptions::FIELD_TITLE_NAME == $fieldName) {
405+
if (CustomOptions::FIELD_TITLE_NAME === $fieldName) {
406406
$option[CustomOptions::FIELD_IS_USE_DEFAULT] = $overwrite;
407407
}
408408
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,13 +254,13 @@ protected function _saveValueTitles(AbstractModel $object)
254254
}
255255
} else {
256256
// we should insert record into not default store only of if it does not exist in default store
257-
if (($storeId == Store::DEFAULT_STORE_ID && !$existInDefaultStore) ||
257+
if (((int)$storeId === Store::DEFAULT_STORE_ID && !$existInDefaultStore) ||
258258
(
259-
$storeId != Store::DEFAULT_STORE_ID &&
259+
(int)$storeId !== Store::DEFAULT_STORE_ID &&
260260
!$isDeleteStoreTitle &&
261-
($object->getDefaultTitle() != null && $object->getTitle() !== $object->getDefaultTitle())
261+
($object->getDefaultTitle() !== null && $object->getTitle() !== $object->getDefaultTitle())
262262
) ||
263-
($object->getIsUseDefault() != null && !(int)$object->getIsUseDefault())
263+
($object->getIsUseDefault() !== null && !(int)$object->getIsUseDefault())
264264
) {
265265
$data = $this->_prepareDataForTable(
266266
new \Magento\Framework\DataObject(

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,12 +284,12 @@ protected function _saveValueTitles(AbstractModel $object)
284284
Store::DEFAULT_STORE_ID
285285
);
286286
// we should insert record into not default store only of if it does not exist in default store
287-
if (($storeId == Store::DEFAULT_STORE_ID && !$existInDefaultStore) ||
287+
if (((int)$storeId === Store::DEFAULT_STORE_ID && !$existInDefaultStore) ||
288288
(
289-
$storeId != Store::DEFAULT_STORE_ID &&
290-
($object->getDefaultTitle() != null && $object->getTitle() !== $object->getDefaultTitle())
289+
(int)$storeId !== Store::DEFAULT_STORE_ID &&
290+
($object->getDefaultTitle() !== null && $object->getTitle() !== $object->getDefaultTitle())
291291
) ||
292-
($object->getIsUseDefault() != null && !(int)$object->getIsUseDefault())
292+
($object->getIsUseDefault() !== null && !(int)$object->getIsUseDefault())
293293
) {
294294
$bind = [
295295
'option_type_id' => (int)$object->getId(),

0 commit comments

Comments
 (0)