Skip to content

Commit

Permalink
Merge branch '2.4-develop' into fix-undefined-constant-when-plugin-is…
Browse files Browse the repository at this point in the history
…-declared
  • Loading branch information
engcom-Kilo authored Jul 1, 2020
2 parents 54531b3 + ba25897 commit 1785136
Show file tree
Hide file tree
Showing 368 changed files with 15,841 additions and 1,427 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,10 @@ public function execute()
unset($data['apply_to']);
}

if ($model->getBackendType() == 'static' && !$model->getIsUserDefined()) {
$data['frontend_class'] = $model->getFrontendClass();
}

$model->addData($data);

if (!$attributeId) {
Expand Down
12 changes: 6 additions & 6 deletions app/code/Magento/Catalog/Model/FilterProductCustomAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@
namespace Magento\Catalog\Model;

/**
* Filter custom attributes for product using the blacklist
* Filter custom attributes for product using the excluded list
*/
class FilterProductCustomAttribute
{
/**
* @var array
*/
private $blackList;
private $excludedList;

/**
* @param array $blackList
* @param array $excludedList
*/
public function __construct(array $blackList = [])
public function __construct(array $excludedList = [])
{
$this->blackList = $blackList;
$this->excludedList = $excludedList;
}

/**
Expand All @@ -33,6 +33,6 @@ public function __construct(array $blackList = [])
*/
public function execute(array $attributes): array
{
return array_diff_key($attributes, array_flip($this->blackList));
return array_diff_key($attributes, array_flip($this->excludedList));
}
}
8 changes: 4 additions & 4 deletions app/code/Magento/Catalog/Model/Layer/Filter/Price/Render.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ public function renderRangeLabel($fromPrice, $toPrice)
}

/**
* Prepare range data
*
* @param int $range
* @param int[] $dbRanges
* @return array
Expand All @@ -81,12 +83,10 @@ public function renderRangeData($range, $dbRanges)
if (empty($dbRanges)) {
return [];
}
$lastIndex = array_keys($dbRanges);
$lastIndex = $lastIndex[count($lastIndex) - 1];

foreach ($dbRanges as $index => $count) {
$fromPrice = $index == 1 ? '' : ($index - 1) * $range;
$toPrice = $index == $lastIndex ? '' : $index * $range;
$fromPrice = $index == 1 ? 0 : ($index - 1) * $range;
$toPrice = $index * $range;
$this->itemDataBuilder->addItemData(
$this->renderRangeLabel($fromPrice, $toPrice),
$fromPrice . '-' . $toPrice,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ public function getFailedItems()
}
}

/**
* Clear validation messages to prevent wrong validation for subsequent price update.
* Work around for backward compatible changes.
*/
$this->failedItems = [];

return $failedItems;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@
use Magento\Catalog\Model\Category;

/**
* Aggregate count for parent category after deleting child category
*
* Class AggregateCount
*/
class AggregateCount
{
/**
* Reduces children count for parent categories
*
* @param Category $category
* @return void
*/
Expand All @@ -25,9 +29,7 @@ public function processDelete(Category $category)
*/
$parentIds = $category->getParentIds();
if ($parentIds) {
$childDecrease = $category->getChildrenCount() + 1;
// +1 is itself
$data = ['children_count' => new \Zend_Db_Expr('children_count - ' . $childDecrease)];
$data = ['children_count' => new \Zend_Db_Expr('children_count - 1')];
$where = ['entity_id IN(?)' => $parentIds];
$resourceModel->getConnection()->update($resourceModel->getEntityTable(), $data, $where);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?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="AdminEnableCategoryActionGroup">
<annotations>
<description>Enable the category</description>
</annotations>
<click selector="{{AdminCategoryBasicFieldSection.enableCategoryLabel}}" stepKey="enableCategory"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?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="AdminSetManageStockConfigActionGroup">
<annotations>
<description>Set "Manage Stock" config in 'Advanced Inventory' panel on the Admin Product creation/edit page.</description>
</annotations>
<arguments>
<argument name="value" type="string"/>
</arguments>
<uncheckOption selector="{{AdminProductFormAdvancedInventorySection.useConfigSettings}}" stepKey="uncheckConfigSetting"/>
<selectOption selector="{{AdminProductFormAdvancedInventorySection.manageStock}}" userInput="{{value}}"
stepKey="setManageStockConfig"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?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="AdminSetMaxAllowedQtyForProductActionGroup">
<annotations>
<description>Fills in the "Maximum Qty Allowed in Shopping Cart" option in 'Advanced Inventory' panel on the Admin Product creation/edit page.</description>
</annotations>
<arguments>
<argument name="qty" type="string"/>
</arguments>
<uncheckOption selector="{{AdminProductFormAdvancedInventorySection.maxiQtyConfigSetting}}" stepKey="uncheckMaxQtyCheckBox"/>
<fillField selector="{{AdminProductFormAdvancedInventorySection.maxiQtyAllowedInCart}}" userInput="{{qty}}"
stepKey="fillMaxAllowedQty"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?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="AdminSetMinAllowedQtyForProductActionGroup">
<annotations>
<description>Fills in the "Minimum Qty Allowed in Shopping Cart" option in 'Advanced Inventory' panel on the Admin Product creation/edit page.</description>
</annotations>
<arguments>
<argument name="qty" type="string"/>
</arguments>
<uncheckOption selector="{{AdminProductFormAdvancedInventorySection.miniQtyConfigSetting}}" stepKey="uncheckMiniQtyCheckBox"/>
<fillField selector="{{AdminProductFormAdvancedInventorySection.miniQtyAllowedInCart}}" userInput="{{qty}}"
stepKey="fillMinAllowedQty"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?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="AdminSetNotifyBelowQtyValueActionGroup">
<annotations>
<description>Fills in the "Notify for Quantity Below" option in 'Advanced Inventory' panel on the Admin Product creation/edit page.</description>
</annotations>
<arguments>
<argument name="qty" type="string"/>
</arguments>
<uncheckOption selector="{{AdminProductFormAdvancedInventorySection.notifyBelowQtyConfigSetting}}"
stepKey="uncheckNotifyBelowQtyCheckBox"/>
<fillField selector="{{AdminProductFormAdvancedInventorySection.notifyBelowQty}}" userInput="{{qty}}"
stepKey="fillNotifyBelowQty"/>
</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="AdminSetQtyUsesDecimalsConfigActionGroup">
<annotations>
<description>Set "Qty Uses Decimals" config in 'Advanced Inventory' panel on the Admin Product creation/edit page.</description>
</annotations>
<arguments>
<argument name="value" type="string"/>
</arguments>
<selectOption selector="{{AdminProductFormAdvancedInventorySection.qtyUsesDecimals}}" userInput="{{value}}"
stepKey="setQtyUsesDecimalsConfig"/>
</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="AdminSetStockStatusConfigActionGroup">
<annotations>
<description>Set "Stock status" config in 'Advanced Inventory' panel on the Admin Product creation/edit page.</description>
</annotations>
<arguments>
<argument name="stockStatus" type="string"/>
</arguments>
<selectOption selector="{{AdminProductFormAdvancedInventorySection.advancedInventoryStockStatus}}"
userInput="{{stockStatus}}" stepKey="selectStockStatus"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?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="AssertAdminCategoryIsListedInCategoriesTreeActionGroup">
<arguments>
<argument name="categoryName" type="string"/>
</arguments>
<seeElement selector="{{AdminCategorySidebarTreeSection.categoryInTree(categoryName)}}" stepKey="seeCategoryInTree"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?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="AssertAdminCategoryIsNotListedInCategoriesTreeActionGroup">
<arguments>
<argument name="categoryName" type="string"/>
</arguments>
<dontSee selector="{{AdminCategorySidebarTreeSection.categoryInTree(categoryName)}}" stepKey="doNotSeeCategoryInTree"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?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="StorefrontAssertProductPageAddToWishlistButtonIsNotPresentActionGroup">
<dontSee userInput="Add to Wish List" selector="{{StorefrontProductPageSection.addToWishlist}}" stepKey="dontSeeElement"/>
</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="StorefrontSwitchStoreActionGroup">
<annotations>
<description>Switch the Storefront to the provided Store.</description>
</annotations>
<arguments>
<argument name="storeName" type="string"/>
</arguments>
<click selector="{{StorefrontFooterSection.switchStoreButton}}" stepKey="clickOnSwitchStoreButton"/>
<click selector="{{StorefrontFooterSection.storeLink(storeName)}}" stepKey="selectStoreToSwitchOn"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,9 @@
<data key="label">No</data>
<data key="value">0</data>
</entity>
<entity name="CatalogInventoryOptionsOnlyXleftThreshold">
<!-- Magento default value -->
<data key="path">cataloginventory/options/stock_threshold_qty</data>
<data key="value">0</data>
</entity>
</entities>
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@
<element name="customOptionDropDown" type="select" selector="//*[@id='product-options-wrapper']//select[contains(@class, 'product-custom-option admin__control-select')]"/>
<element name="qtyInputWithProduct" type="input" selector="//tr//strong[contains(.,'{{productName}}')]/../../td[@class='col qty']//input" parameterized="true"/>
<element name="customOptionRadio" type="input" selector="//span[contains(text(),'{{customOption}}')]/../../input" parameterized="true"/>
<element name="onlyProductsLeft" type="block" selector="//div[@class='product-info-price']//div[@class='product-info-stock-sku']//div[@class='availability only']"/>
</section>
</sections>
</sections>
Loading

0 comments on commit 1785136

Please sign in to comment.