Skip to content

Commit 8b3ec1e

Browse files
author
olysenko
committed
Merge remote-tracking branch 'origin/MAGETWO-53070' into pr
2 parents 4475be6 + 58b2d77 commit 8b3ec1e

File tree

2 files changed

+3
-6
lines changed
  • app/code/Magento/Catalog

2 files changed

+3
-6
lines changed

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,6 @@ public function initializeFromData(\Magento\Catalog\Model\Product $product, arra
170170
$product->lockAttribute('media');
171171
}
172172

173-
if ($this->storeManager->hasSingleStore() && empty($product->getWebsiteIds())) {
174-
$product->setWebsiteIds([$this->storeManager->getStore(true)->getWebsite()->getId()]);
175-
}
176-
177173
/**
178174
* Check "Use Default Value" checkboxes values
179175
*/

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,9 @@ public function delete($object)
315315
*/
316316
protected function _saveWebsiteIds($product)
317317
{
318-
if (empty(array_diff($product->getWebsiteIds(), [0]))) {
319-
$product->setWebsiteIds([1]);
318+
if ($this->_storeManager->isSingleStoreMode()) {
319+
$id = $this->_storeManager->getDefaultStoreView()->getWebsiteId();
320+
$product->setWebsiteIds([$id]);
320321
}
321322
$websiteIds = $product->getWebsiteIds();
322323

0 commit comments

Comments
 (0)