-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'mainline/develop' into BUGS
- Loading branch information
Showing
17 changed files
with
440 additions
and
44 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
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,76 @@ | ||
<?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.2') < 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
4 changes: 4 additions & 0 deletions
4
...e/Magento/CatalogImportExport/Model/Import/_files/products_to_import_without_url_keys.csv
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,4 @@ | ||
sku,product_type,store_view_code,name,price,attribute_set_code,url_key | ||
simple1,simple,,"simple 1",25,Default,"" | ||
simple2,simple,,"simple 2",34,Default,"" | ||
simple3,simple,,"simple 3",58,Default,"" |
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
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.