Skip to content

Commit 1445a66

Browse files
committed
Merge remote-tracking branch 'origin/2.3-develop' into MC-18995
2 parents a7d9330 + 61a5a30 commit 1445a66

File tree

78 files changed

+3116
-266
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+3116
-266
lines changed

app/code/Magento/Bundle/Test/Mftf/Test/AdminRemoveDefaultImageBundleProductTest.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
<createData entity="SimpleProduct2" stepKey="simpleProduct2"/>
2525
</before>
2626
<after>
27+
<!-- Delete the bundled product we created in the test body -->
28+
<actionGroup ref="deleteProductBySku" stepKey="deleteBundleProduct">
29+
<argument name="sku" value="{{BundleProduct.sku}}"/>
30+
</actionGroup>
2731
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
2832
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
2933
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>

app/code/Magento/Catalog/Model/Indexer/Product/Category/Action/Rows.php

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function execute(array $entityIds = [], $useTempTable = false)
105105
* @throws \Exception if metadataPool doesn't contain metadata for ProductInterface
106106
* @throws \DomainException
107107
*/
108-
private function getProductIdsWithParents(array $childProductIds)
108+
private function getProductIdsWithParents(array $childProductIds): array
109109
{
110110
/** @var \Magento\Framework\EntityManager\EntityMetadataInterface $metadata */
111111
$metadata = $this->metadataPool->getMetadata(\Magento\Catalog\Api\Data\ProductInterface::class);
@@ -123,8 +123,12 @@ private function getProductIdsWithParents(array $childProductIds)
123123
);
124124

125125
$parentProductIds = $this->connection->fetchCol($select);
126+
$ids = array_unique(array_merge($childProductIds, $parentProductIds));
127+
foreach ($ids as $key => $id) {
128+
$ids[$key] = (int) $id;
129+
}
126130

127-
return array_unique(array_merge($childProductIds, $parentProductIds));
131+
return $ids;
128132
}
129133

130134
/**
@@ -175,7 +179,7 @@ protected function removeEntries()
175179
protected function getNonAnchorCategoriesSelect(\Magento\Store\Model\Store $store)
176180
{
177181
$select = parent::getNonAnchorCategoriesSelect($store);
178-
return $select->where('ccp.product_id IN (?) OR relation.child_id IN (?)', $this->limitationByProducts);
182+
return $select->where('ccp.product_id IN (?)', $this->limitationByProducts);
179183
}
180184

181185
/**
@@ -216,28 +220,28 @@ protected function isRangingNeeded()
216220
* Returns a list of category ids which are assigned to product ids in the index
217221
*
218222
* @param array $productIds
219-
* @return \Magento\Framework\Indexer\CacheContext
223+
* @return array
220224
*/
221-
private function getCategoryIdsFromIndex(array $productIds)
225+
private function getCategoryIdsFromIndex(array $productIds): array
222226
{
223227
$categoryIds = [];
224228
foreach ($this->storeManager->getStores() as $store) {
225-
$categoryIds = array_merge(
226-
$categoryIds,
227-
$this->connection->fetchCol(
228-
$this->connection->select()
229-
->from($this->getIndexTable($store->getId()), ['category_id'])
230-
->where('product_id IN (?)', $productIds)
231-
->distinct()
232-
)
229+
$storeCategories = $this->connection->fetchCol(
230+
$this->connection->select()
231+
->from($this->getIndexTable($store->getId()), ['category_id'])
232+
->where('product_id IN (?)', $productIds)
233+
->distinct()
233234
);
235+
$categoryIds[] = $storeCategories;
234236
}
235-
$parentCategories = $categoryIds;
237+
$categoryIds = array_merge(...$categoryIds);
238+
239+
$parentCategories = [$categoryIds];
236240
foreach ($categoryIds as $categoryId) {
237241
$parentIds = explode('/', $this->getPathFromCategoryId($categoryId));
238-
$parentCategories = array_merge($parentCategories, $parentIds);
242+
$parentCategories[] = $parentIds;
239243
}
240-
$categoryIds = array_unique($parentCategories);
244+
$categoryIds = array_unique(array_merge(...$parentCategories));
241245

242246
return $categoryIds;
243247
}

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategorySidebarSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
<element name="filterOptions" type="text" selector=".filter-options-content .items"/>
1313
<element name="filterOption" type="text" selector=".filter-options-content .item"/>
1414
<element name="optionQty" type="text" selector=".filter-options-content .item .count"/>
15+
<element name="filterOptionByLabel" type="button" selector=" div.filter-options-item div[option-label='{{optionLabel}}']" parameterized="true"/>
16+
<element name="removeFilter" type="button" selector="div.filter-current .remove"/>
1517
</section>
1618
<section name="StorefrontCategorySidebarMobileSection">
1719
<element name="shopByButton" type="button" selector="//div[contains(@class, 'filter-title')]/strong[contains(text(), 'Shop By')]"/>

app/code/Magento/CatalogGraphQl/Model/Resolver/Product/PriceRange.php

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,16 @@ public function resolve(
6262
$product = $value['model'];
6363
$product->unsetData('minimal_price');
6464

65-
return [
66-
'minimum_price' => $this->getMinimumProductPrice($product, $store),
67-
'maximum_price' => $this->getMaximumProductPrice($product, $store)
68-
];
65+
$requestedFields = $info->getFieldSelection(10);
66+
$returnArray = [];
67+
68+
if (isset($requestedFields['minimum_price'])) {
69+
$returnArray['minimum_price'] = $this->getMinimumProductPrice($product, $store);
70+
}
71+
if (isset($requestedFields['maximum_price'])) {
72+
$returnArray['maximum_price'] = $this->getMaximumProductPrice($product, $store);
73+
}
74+
return $returnArray;
6975
}
7076

7177
/**
@@ -80,8 +86,9 @@ private function getMinimumProductPrice(SaleableInterface $product, StoreInterfa
8086
$priceProvider = $this->priceProviderPool->getProviderByProductType($product->getTypeId());
8187
$regularPrice = $priceProvider->getMinimalRegularPrice($product)->getValue();
8288
$finalPrice = $priceProvider->getMinimalFinalPrice($product)->getValue();
83-
84-
return $this->formatPrice($regularPrice, $finalPrice, $store);
89+
$minPriceArray = $this->formatPrice($regularPrice, $finalPrice, $store);
90+
$minPriceArray['model'] = $product;
91+
return $minPriceArray;
8592
}
8693

8794
/**
@@ -96,8 +103,9 @@ private function getMaximumProductPrice(SaleableInterface $product, StoreInterfa
96103
$priceProvider = $this->priceProviderPool->getProviderByProductType($product->getTypeId());
97104
$regularPrice = $priceProvider->getMaximalRegularPrice($product)->getValue();
98105
$finalPrice = $priceProvider->getMaximalFinalPrice($product)->getValue();
99-
100-
return $this->formatPrice($regularPrice, $finalPrice, $store);
106+
$maxPriceArray = $this->formatPrice($regularPrice, $finalPrice, $store);
107+
$maxPriceArray['model'] = $product;
108+
return $maxPriceArray;
101109
}
102110

103111
/**

app/code/Magento/CatalogGraphQl/etc/schema.graphqls

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ type Price @doc(description: "Price is deprecated, replaced by ProductPrice. The
2121
adjustments: [PriceAdjustment] @deprecated(reason: "Price is deprecated, use ProductPrice.") @doc(description: "An array that provides information about tax, weee, or weee_tax adjustments.")
2222
}
2323

24-
type PriceAdjustment @doc(description: "The PricedAdjustment object defines the amount of money to apply as an adjustment, the type of adjustment to apply, and whether the item is included or excluded from the adjustment.") {
24+
type PriceAdjustment @doc(description: "PriceAdjustment is deprecated. Taxes will be included or excluded in the price. The PricedAdjustment object defines the amount of money to apply as an adjustment, the type of adjustment to apply, and whether the item is included or excluded from the adjustment.") {
2525
amount: Money @doc(description: "The amount of the price adjustment and its currency code.")
26-
code: PriceAdjustmentCodesEnum @doc(description: "Indicates whether the adjustment involves tax, weee, or weee_tax.")
27-
description: PriceAdjustmentDescriptionEnum @doc(description: "Indicates whether the entity described by the code attribute is included or excluded from the adjustment.")
26+
code: PriceAdjustmentCodesEnum @deprecated(reason: "PriceAdjustment is deprecated.") @doc(description: "Indicates whether the adjustment involves tax, weee, or weee_tax.")
27+
description: PriceAdjustmentDescriptionEnum @deprecated(reason: "PriceAdjustment is deprecated.") @doc(description: "Indicates whether the entity described by the code attribute is included or excluded from the adjustment.")
2828
}
2929

30-
enum PriceAdjustmentCodesEnum @doc(description: "Note: This enumeration contains values defined in modules other than the Catalog module.") {
30+
enum PriceAdjustmentCodesEnum @doc(description: "PriceAdjustment.code is deprecated. This enumeration contains values defined in modules other than the Catalog module.") {
3131
}
3232

33-
enum PriceAdjustmentDescriptionEnum @doc(description: "This enumeration states whether a price adjustment is included or excluded.") {
33+
enum PriceAdjustmentDescriptionEnum @doc(description: "PriceAdjustmentDescriptionEnum is deprecated. This enumeration states whether a price adjustment is included or excluded.") {
3434
INCLUDED
3535
EXCLUDED
3636
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminAssertDisabledQtyActionGroup">
12+
<annotations>
13+
<description>Goes to the 'Quantity' field and assert disabled attribute.</description>
14+
</annotations>
15+
16+
<seeElement selector="{{AdminProductFormSection.productQuantity}}" stepKey="assertProductQty"/>
17+
<assertElementContainsAttribute selector="{{AdminProductFormSection.productQuantity}}" attribute="disabled" expectedValue="true" stepKey="checkIfQtyIsDisabled" />
18+
</actionGroup>
19+
</actionGroups>

app/code/Magento/CatalogInventory/Ui/DataProvider/Product/Form/Modifier/AdvancedInventory.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
<?php
2-
3-
declare(strict_types=1);
4-
52
/**
63
* Copyright © Magento, Inc. All rights reserved.
74
* See COPYING.txt for license details.
85
*/
6+
declare(strict_types=1);
7+
98
namespace Magento\CatalogInventory\Ui\DataProvider\Product\Form\Modifier;
109

1110
use Magento\Catalog\Controller\Adminhtml\Product\Initialization\StockDataFilter;
@@ -238,7 +237,7 @@ private function prepareMeta()
238237
$this->meta = $this->arrayManager->merge(
239238
$fieldsetPath . '/children',
240239
$this->meta,
241-
['container_quantity_and_stock_status_qty' => $container]
240+
['quantity_and_stock_status_qty' => $container]
242241
);
243242
}
244243
}

0 commit comments

Comments
 (0)