-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #553 from magento-okapis
Fixed issue: - MAGETWO-56804 [Backport] Product catalog Import/export - Date & Timezone issue - for 2.1 - MAGETWO-58312 [Backport][GitHub] Products became “out of stock” after update from 2.0.7 to 2.1.0 #5222 - for 2.1
- Loading branch information
Showing
10 changed files
with
195 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<?php | ||
/** | ||
* Copyright © 2016 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\CatalogInventory\Setup; | ||
|
||
use Magento\CatalogInventory\Api\StockConfigurationInterface; | ||
use Magento\Framework\Indexer\AbstractProcessor; | ||
use Magento\Framework\Setup\UpgradeDataInterface; | ||
use Magento\Framework\Setup\ModuleContextInterface; | ||
use Magento\Framework\Setup\ModuleDataSetupInterface; | ||
use Magento\Store\Model\StoreManagerInterface; | ||
|
||
/** | ||
* Upgrade Data script | ||
* @codeCoverageIgnore | ||
*/ | ||
class UpgradeData implements UpgradeDataInterface | ||
{ | ||
/** | ||
* @var StockConfigurationInterface | ||
*/ | ||
private $configuration; | ||
|
||
/** | ||
* @var AbstractProcessor | ||
*/ | ||
private $indexerProcessor; | ||
|
||
/** | ||
* @var StoreManagerInterface | ||
*/ | ||
private $storeManager; | ||
|
||
/** | ||
* @param StockConfigurationInterface $configuration | ||
* @param StoreManagerInterface $storeManager | ||
* @param AbstractProcessor $indexerProcessor | ||
*/ | ||
public function __construct( | ||
StockConfigurationInterface $configuration, | ||
StoreManagerInterface $storeManager, | ||
AbstractProcessor $indexerProcessor | ||
) { | ||
$this->configuration = $configuration; | ||
$this->storeManager = $storeManager; | ||
$this->indexerProcessor = $indexerProcessor; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context) | ||
{ | ||
$setup->startSetup(); | ||
if (version_compare($context->getVersion(), '2.0.1') < 0) | ||
{ | ||
$this->upgradeCatalogInventoryStockItem($setup); | ||
} | ||
$setup->endSetup(); | ||
} | ||
|
||
/** | ||
* @param ModuleDataSetupInterface $setup | ||
* @return void | ||
*/ | ||
private function upgradeCatalogInventoryStockItem($setup) | ||
{ | ||
$setup->getConnection()->update( | ||
$setup->getTable('cataloginventory_stock_item'), | ||
['website_id' => $this->configuration->getDefaultScopeId()], | ||
['website_id = ?' => $this->storeManager->getWebsite()->getId()] | ||
); | ||
$this->indexerProcessor->getIndexer()->invalidate(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.