Skip to content

Commit

Permalink
Merge branch '2.4-develop-mainline' into 21853
Browse files Browse the repository at this point in the history
  • Loading branch information
engcom-Foxtrot committed Oct 1, 2020
2 parents ff56be5 + f7759d8 commit e16f2c2
Show file tree
Hide file tree
Showing 196 changed files with 4,842 additions and 829 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ public function __construct(
protected function initTypeModels()
{
$productTypes = $this->_exportConfig->getEntityTypes(CatalogProduct::ENTITY);
$disabledAttrs = [];
$indexValueAttributes = [];
foreach ($productTypes as $productTypeName => $productTypeConfig) {
if (!($model = $this->_typeFactory->create($productTypeConfig['model']))) {
throw new \Magento\Framework\Exception\LocalizedException(
Expand All @@ -174,21 +176,19 @@ protected function initTypeModels()
}
if ($model->isSuitable()) {
$this->_productTypeModels[$productTypeName] = $model;
// phpcs:ignore Magento2.Performance.ForeachArrayMerge
$this->_disabledAttrs = array_merge($this->_disabledAttrs, $model->getDisabledAttrs());
// phpcs:ignore Magento2.Performance.ForeachArrayMerge
$this->_indexValueAttributes = array_merge(
$this->_indexValueAttributes,
$model->getIndexValueAttributes()
);
$disabledAttrs[] = $model->getDisabledAttrs();
$indexValueAttributes[] = $model->getIndexValueAttributes();
}
}
if (!$this->_productTypeModels) {
throw new \Magento\Framework\Exception\LocalizedException(
__('There are no product types available for export')
);
}
$this->_disabledAttrs = array_unique($this->_disabledAttrs);
$this->_disabledAttrs = array_unique(array_merge([], $this->_disabledAttrs, ...$disabledAttrs));
$this->_indexValueAttributes = array_unique(
array_merge([], $this->_indexValueAttributes, ...$indexValueAttributes)
);
return $this;
}

Expand Down Expand Up @@ -518,6 +518,8 @@ protected function getTierPrices(array $listSku, $table)
if (isset($this->_parameters[\Magento\ImportExport\Model\Export::FILTER_ELEMENT_GROUP])) {
$exportFilter = $this->_parameters[\Magento\ImportExport\Model\Export::FILTER_ELEMENT_GROUP];
}
$selectFields = [];
$exportData = false;
if ($table == ImportAdvancedPricing::TABLE_TIER_PRICE) {
$selectFields = [
ImportAdvancedPricing::COL_SKU => 'cpe.sku',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ public function process(string $encodedMessage)
$status = OperationInterface::STATUS_TYPE_COMPLETE;
$errorCode = null;
$messages = [];
$entityParams = [];
$topicName = $operation->getTopicName();
$handlers = $this->configuration->getHandlers($topicName);
try {
Expand All @@ -127,7 +128,7 @@ public function process(string $encodedMessage)
$this->logger->error($e->getMessage());
$status = OperationInterface::STATUS_TYPE_NOT_RETRIABLY_FAILED;
$errorCode = $e->getCode();
$messages[] = $e->getMessage();
$messages[] = [$e->getMessage()];
}

$outputData = null;
Expand All @@ -136,9 +137,7 @@ public function process(string $encodedMessage)
$result = $this->executeHandler($callback, $entityParams);
$status = $result['status'];
$errorCode = $result['error_code'];
// phpcs:disable Magento2.Performance.ForeachArrayMerge
$messages = array_merge($messages, $result['messages']);
// phpcs:enable Magento2.Performance.ForeachArrayMerge
$messages[] = $result['messages'];
$outputData = $result['output_data'];
}
}
Expand All @@ -157,7 +156,7 @@ public function process(string $encodedMessage)
);
$outputData = $this->jsonHelper->serialize($outputData);
} catch (\Exception $e) {
$messages[] = $e->getMessage();
$messages[] = [$e->getMessage()];
}
}

Expand All @@ -167,7 +166,7 @@ public function process(string $encodedMessage)
$operation->getId(),
$status,
$errorCode,
implode('; ', $messages),
implode('; ', array_merge([], ...$messages)),
$serializedData,
$outputData
);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?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="AdminOpenConfigurationStoresPageActionGroup">
<annotations>
<description>Open configuration stores page.</description>
</annotations>

<amOnPage url="{{AdminConfigurationStoresPage.url}}" stepKey="goToConfigurationStoresPage"/>
<waitForPageLoad stepKey="waitPageLoad"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
<page name="AdminConfigurationStoresPage" url="admin/system_config/edit/section/cms/" area="admin" module="Catalog">
<section name="WYSIWYGOptionsSection"/>
</page>
</pages>
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
-->
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
<!-- @deprecated New Page was introduced. Please use "AdminConfigurationStoresPage" -->
<page name="ConfigurationStoresPage" url="admin/system_config/edit/section/cms/" area="admin" module="Catalog">
<section name="WYSIWYGOptionsSection"/>
</page>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,21 @@

<click selector="{{AdminMenuSection.stores}}" stepKey="clickStoresMenuOption1"/>
<waitForLoadingMaskToDisappear stepKey="waitForStoresMenu1" />
<waitForElementVisible selector="{{AdminMenuSection.configuration}}" stepKey="waitForConfigurationVisible1"/>
<click selector="{{AdminMenuSection.configuration}}" stepKey="clickStoresConfigurationMenuOption1"/>
<waitForPageLoad stepKey="waitForConfigurationPageLoad1"/>
<seeCurrentUrlMatches regex="~\/admin\/system_config\/~" stepKey="seeCurrentUrlMatchesConfigPath1"/>

<click selector="{{AdminMenuSection.catalog}}" stepKey="clickCatalogMenuOption"/>
<waitForLoadingMaskToDisappear stepKey="waitForCatalogMenu1" />
<waitForElementVisible selector="{{AdminMenuSection.catalogProducts}}" stepKey="waitForCatalogProductsVisible"/>
<click selector="{{AdminMenuSection.catalogProducts}}" stepKey="clickCatalogProductsMenuOption"/>
<waitForPageLoad stepKey="waitForProductsPageLoad"/>
<seeCurrentUrlMatches regex="~\/catalog\/product\/~" stepKey="seeCurrentUrlMatchesProductsPath"/>

<click selector="{{AdminMenuSection.stores}}" stepKey="clickStoresMenuOption2"/>
<waitForLoadingMaskToDisappear stepKey="waitForStoresMenu2" />
<waitForElementVisible selector="{{AdminMenuSection.configuration}}" stepKey="waitForConfigurationVisible2"/>
<click selector="{{AdminMenuSection.configuration}}" stepKey="clickStoresConfigurationMenuOption2"/>
<waitForPageLoad stepKey="waitForConfigurationPageLoad2"/>
<seeCurrentUrlMatches regex="~\/admin\/system_config\/~" stepKey="seeCurrentUrlMatchesConfigPath2"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,10 @@ public function testGetterAmount($amountForBundle, $optionList, $expectedResult)

$optionSelections = [];
foreach ($options as $option) {
// phpcs:ignore Magento2.Performance.ForeachArrayMerge
$optionSelections = array_merge($optionSelections, $option->getSelections());
$optionSelections[] = $option->getSelections();
}
$optionSelections = array_merge([], ...$optionSelections);

$this->selectionPriceListProvider->expects($this->any())->method('getPriceList')->willReturn($optionSelections);

$price = $this->createMock(BundleOptionPrice::class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -603,19 +603,15 @@ protected function populateInsertOptionValues(array $optionIds): array
if ($assoc['position'] == $this->_cachedOptions[$entityId][$key]['index']
&& $assoc['parent_id'] == $entityId) {
$option['parent_id'] = $entityId;
//phpcs:ignore Magento2.Performance.ForeachArrayMerge
$optionValues = array_merge(
$optionValues,
$this->populateOptionValueTemplate($option, $optionId)
);
$optionValues[] = $this->populateOptionValueTemplate($option, $optionId);
$this->_cachedOptions[$entityId][$key]['option_id'] = $optionId;
break;
}
}
}
}

return $optionValues;
return array_merge([], ...$optionValues);
}

/**
Expand Down
Loading

0 comments on commit e16f2c2

Please sign in to comment.