Skip to content

Commit

Permalink
Merge branch '2.4-develop' into fix-28388
Browse files Browse the repository at this point in the history
  • Loading branch information
engcom-Kilo committed Jun 9, 2020
2 parents c6c3231 + bb176b8 commit eafdb17
Show file tree
Hide file tree
Showing 3,634 changed files with 13,072 additions and 227,403 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/story.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: GraphQL Story
about: User story for GraphQL project
labels: 'Project: GraphQL'

---

*As a ___ I want to ___ so that ___.*

### AC
* a
* b
### Approved Schema
* a
3 changes: 0 additions & 3 deletions .php_cs.dist
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@

$finder = PhpCsFixer\Finder::create()
->name('*.phtml')
->exclude('dev/tests/functional/generated')
->exclude('dev/tests/functional/var')
->exclude('dev/tests/functional/vendor')
->exclude('dev/tests/integration/tmp')
->exclude('dev/tests/integration/var')
->exclude('lib/internal/Cm')
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="CliCacheCleanActionGroup">
<annotations>
<description>Run cache:clean by CLI with specified cache tags (space separated).</description>
</annotations>
<arguments>
<argument name="tags" type="string"/>
</arguments>

<magentoCLI command="cache:clean" arguments="{{tags}}" stepKey="cleanSpecifiedCache"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="CliCacheFlushActionGroup">
<annotations>
<description>Run cache:flush by CLI with specified cache tags (space separated).</description>
</annotations>
<arguments>
<argument name="tags" type="string"/>
</arguments>

<magentoCLI command="cache:flush" arguments="{{tags}}" stepKey="flushSpecifiedCache"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<group value="login"/>
</annotations>


<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
<actionGroup ref="AssertAdminSuccessLoginActionGroup" stepKey="assertLoggedIn"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>
Expand Down
20 changes: 7 additions & 13 deletions app/code/Magento/Bundle/Model/ResourceModel/Indexer/Price.php
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,7 @@ private function prepareBundlePriceByType($priceType, array $dimensions, $entity
]
);

$query = $select->insertFromSelect($this->getBundlePriceTable());
$connection->query($query);
$this->tableMaintainer->insertFromSelect($select, $this->getBundlePriceTable(), []);
}

/**
Expand Down Expand Up @@ -418,8 +417,7 @@ private function calculateBundleOptionPrice($priceTable, $dimensions)
]
);

$query = $select->insertFromSelect($this->getBundleOptionTable());
$connection->query($query);
$this->tableMaintainer->insertFromSelect($select, $this->getBundleOptionTable(), []);

$this->getConnection()->delete($priceTable->getTableName());
$this->applyBundlePrice($priceTable);
Expand Down Expand Up @@ -575,8 +573,7 @@ private function calculateFixedBundleSelectionPrice()
'tier_price' => $tierExpr,
]
);
$query = $select->insertFromSelect($this->getBundleSelectionTable());
$connection->query($query);
$this->tableMaintainer->insertFromSelect($select, $this->getBundleSelectionTable(), []);

$this->applyFixedBundleSelectionPrice();
}
Expand Down Expand Up @@ -627,8 +624,7 @@ private function calculateDynamicBundleSelectionPrice($dimensions)
'tier_price' => $tierExpr,
]
);
$query = $select->insertFromSelect($this->getBundleSelectionTable());
$connection->query($query);
$this->tableMaintainer->insertFromSelect($select, $this->getBundleSelectionTable(), []);
}

/**
Expand Down Expand Up @@ -697,8 +693,7 @@ private function prepareTierPriceIndex($dimensions, $entityIds)
$select->where($this->dimensionToFieldMapper[$dimension->getName()] . ' = ?', $dimension->getValue());
}

$query = $select->insertFromSelect($this->getTable('catalog_product_index_tier_price'));
$connection->query($query);
$this->tableMaintainer->insertFromSelect($select, $this->getTable('catalog_product_index_tier_price'), []);
}

/**
Expand All @@ -725,8 +720,7 @@ private function applyBundlePrice($priceTable): void
]
);

$query = $select->insertFromSelect($priceTable->getTableName());
$this->getConnection()->query($query);
$this->tableMaintainer->insertFromSelect($select, $priceTable->getTableName(), []);
}

/**
Expand Down Expand Up @@ -785,7 +779,7 @@ private function getMainTable($dimensions)
if ($this->fullReindexAction) {
return $this->tableMaintainer->getMainReplicaTable($dimensions);
}
return $this->tableMaintainer->getMainTable($dimensions);
return $this->tableMaintainer->getMainTableByDimensions($dimensions);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<requiredEntity createDataKey="createBundleOption"/>
<requiredEntity createDataKey="createSimpleProduct"/>
</createData>
<magentoCron stepKey="runCronIndex" groups="index"/>
<magentoCLI stepKey="runCronIndex" command="cron:run --group=index"/>
</before>
<after>
<!-- Delete Simple Product -->
Expand All @@ -56,9 +56,11 @@
<actionGroup ref="AdminUpdateProductNameAndDescriptionAttributes" stepKey="updateProductAttribute">
<argument name="product" value="UpdateAttributeNameAndDescription"/>
</actionGroup>
<!--Run cron twice-->
<magentoCLI command="cron:run" stepKey="cronRun"/>
<magentoCLI command="cron:run" stepKey="cronRunTwice"/>
<!-- Start message queue for product attribute consumer -->
<actionGroup ref="CliConsumerStartActionGroup" stepKey="startMessageQueue">
<argument name="consumerName" value="{{AdminProductAttributeUpdateMessageConsumerData.consumerName}}"/>
<argument name="maxMessages" value="{{AdminProductAttributeUpdateMessageConsumerData.messageLimit}}"/>
</actionGroup>
<!-- Search for a product with a new name and Open Product -->
<actionGroup ref="FilterProductGridByNameActionGroup" stepKey="searchWithNewProductName">
<argument name="product" value="UpdateAttributeNameAndDescription"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public function getItems()
$this->_compareProduct->setAllowUsedFlat(false);

$this->_items = $this->_itemCollectionFactory->create();
$this->_items->useProductItem(true)->setStoreId($this->_storeManager->getStore()->getId());
$this->_items->useProductItem()->setStoreId($this->_storeManager->getStore()->getId());

if ($this->httpContext->getValue(Context::CONTEXT_AUTH)) {
$this->_items->setCustomerId($this->currentCustomer->getCustomerId());
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/Catalog/Helper/Product/Compare.php
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ public function getItemCollection()
// cannot be placed in constructor because of the cyclic dependency which cannot be fixed with proxy class
// collection uses this helper in constructor when calling isEnabledFlat() method
$this->_itemCollection = $this->_itemCollectionFactory->create();
$this->_itemCollection->useProductItem(true)->setStoreId($this->_storeManager->getStore()->getId());
$this->_itemCollection->useProductItem()->setStoreId($this->_storeManager->getStore()->getId());

if ($this->_customerSession->isLoggedIn()) {
$this->_itemCollection->setCustomerId($this->_customerSession->getCustomerId());
Expand Down Expand Up @@ -313,7 +313,7 @@ public function calculate($logout = false)
{
/** @var $collection Collection */
$collection = $this->_itemCollectionFactory->create()
->useProductItem(true);
->useProductItem();
if (!$logout && $this->_customerSession->isLoggedIn()) {
$collection->setCustomerId($this->_customerSession->getCustomerId());
} elseif ($this->_customerId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ protected function _syncData(array $processIds = [])
}
}

$query = $insertSelect->insertFromSelect($this->tableMaintainer->getMainTable($dimensions));
$query = $insertSelect->insertFromSelect($this->tableMaintainer->getMainTableByDimensions($dimensions));
$this->getConnection()->query($query);
}
return $this;
Expand Down Expand Up @@ -385,7 +385,7 @@ protected function _reindexRows($changedIds = [])
// copy to index
$this->_insertFromTable(
$temporaryTable,
$this->tableMaintainer->getMainTable($dimensions)
$this->tableMaintainer->getMainTableByDimensions($dimensions)
);
}
} else {
Expand All @@ -401,14 +401,16 @@ protected function _reindexRows($changedIds = [])
}

/**
* Delete Index data
*
* @param array $entityIds
* @return void
*/
private function deleteIndexData(array $entityIds)
{
foreach ($this->dimensionCollectionFactory->create() as $dimensions) {
$select = $this->getConnection()->select()->from(
['index_price' => $this->tableMaintainer->getMainTable($dimensions)],
['index_price' => $this->tableMaintainer->getMainTableByDimensions($dimensions)],
null
)->where('index_price.entity_id IN (?)', $entityIds);
$query = $select->deleteFromSelect('index_price');
Expand Down Expand Up @@ -476,7 +478,7 @@ private function getIndexTargetTableByDimension(array $dimensions)
{
$indexTargetTable = $this->getIndexTargetTable();
if ($indexTargetTable === self::getIndexTargetTable()) {
$indexTargetTable = $this->tableMaintainer->getMainTable($dimensions);
$indexTargetTable = $this->tableMaintainer->getMainTableByDimensions($dimensions);
}
if ($indexTargetTable === self::getIndexTargetTable() . '_replica') {
$indexTargetTable = $this->tableMaintainer->getMainReplicaTable($dimensions);
Expand All @@ -497,6 +499,8 @@ protected function getIndexTargetTable()
}

/**
* Get product Id field name
*
* @return string
*/
protected function getProductIdFieldName()
Expand Down Expand Up @@ -533,6 +537,7 @@ private function getProductsTypes(array $changedIds = [])

/**
* Get parent products types
*
* Used for add composite products to reindex if we have only simple products in changed ids set
*
* @param array $productsIds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ private function switchTables(): void
$mainTablesByDimension = [];

foreach ($this->dimensionCollectionFactory->create() as $dimensions) {
$mainTablesByDimension[] = $this->dimensionTableMaintainer->getMainTable($dimensions);
$mainTablesByDimension[] = $this->dimensionTableMaintainer->getMainTableByDimensions($dimensions);

//Move data from indexers with old realisation
$this->moveDataFromReplicaTableToReplicaTables($dimensions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

/**
* Class to prepare new tables for new indexer mode
*
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class ModeSwitcher implements \Magento\Indexer\Model\ModeSwitcherInterface
{
Expand Down Expand Up @@ -98,7 +100,6 @@ public function switchMode(string $currentMode, string $previousMode)
* Create new tables
*
* @param string $currentMode
*
* @return void
* @throws \Zend_Db_Exception
*/
Expand All @@ -116,7 +117,6 @@ public function createTables(string $currentMode)
*
* @param string $currentMode
* @param string $previousMode
*
* @return void
*/
public function moveData(string $currentMode, string $previousMode)
Expand All @@ -125,17 +125,17 @@ public function moveData(string $currentMode, string $previousMode)
$dimensionsArrayForPreviousMode = $this->getDimensionsArray($previousMode);

foreach ($dimensionsArrayForCurrentMode as $dimensionsForCurrentMode) {
$newTable = $this->tableMaintainer->getMainTable($dimensionsForCurrentMode);
$newTable = $this->tableMaintainer->getMainTableByDimensions($dimensionsForCurrentMode);
if (empty($dimensionsForCurrentMode)) {
// new mode is 'none'
foreach ($dimensionsArrayForPreviousMode as $dimensionsForPreviousMode) {
$oldTable = $this->tableMaintainer->getMainTable($dimensionsForPreviousMode);
$oldTable = $this->tableMaintainer->getMainTableByDimensions($dimensionsForPreviousMode);
$this->insertFromOldTablesToNew($newTable, $oldTable);
}
} else {
// new mode is not 'none'
foreach ($dimensionsArrayForPreviousMode as $dimensionsForPreviousMode) {
$oldTable = $this->tableMaintainer->getMainTable($dimensionsForPreviousMode);
$oldTable = $this->tableMaintainer->getMainTableByDimensions($dimensionsForPreviousMode);
$this->insertFromOldTablesToNew($newTable, $oldTable, $dimensionsForCurrentMode);
}
}
Expand All @@ -146,7 +146,6 @@ public function moveData(string $currentMode, string $previousMode)
* Drop old tables
*
* @param string $previousMode
*
* @return void
*/
public function dropTables(string $previousMode)
Expand All @@ -164,7 +163,6 @@ public function dropTables(string $previousMode)
* Get dimensions array
*
* @param string $mode
*
* @return \Magento\Framework\Indexer\MultiDimensionProvider
*/
private function getDimensionsArray(string $mode): \Magento\Framework\Indexer\MultiDimensionProvider
Expand All @@ -184,7 +182,6 @@ private function getDimensionsArray(string $mode): \Magento\Framework\Indexer\Mu
* @param string $newTable
* @param string $oldTable
* @param Dimension[] $dimensions
*
* @return void
*/
private function insertFromOldTablesToNew(string $newTable, string $oldTable, array $dimensions = [])
Expand Down
Loading

0 comments on commit eafdb17

Please sign in to comment.