Skip to content

Commit d231549

Browse files
authored
Merge branch '2.4-develop' into fix-26976
2 parents a5dba17 + 2841088 commit d231549

File tree

458 files changed

+9135
-1362
lines changed

Some content is hidden

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

458 files changed

+9135
-1362
lines changed

app/code/Magento/AsynchronousOperations/Model/MassConsumer.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,19 @@ public function process($maxNumberOfMessages = null)
6969
$this->registry->register('isSecureArea', true, true);
7070

7171
$queue = $this->configuration->getQueue();
72+
$maxIdleTime = $this->configuration->getMaxIdleTime();
73+
$sleep = $this->configuration->getSleep();
7274

7375
if (!isset($maxNumberOfMessages)) {
7476
$queue->subscribe($this->getTransactionCallback($queue));
7577
} else {
76-
$this->invoker->invoke($queue, $maxNumberOfMessages, $this->getTransactionCallback($queue));
78+
$this->invoker->invoke(
79+
$queue,
80+
$maxNumberOfMessages,
81+
$this->getTransactionCallback($queue),
82+
$maxIdleTime,
83+
$sleep
84+
);
7785
}
7886

7987
$this->registry->unregister('isSecureArea');

app/code/Magento/Backend/Test/Mftf/Test/AdminDashboardWithChartsTest.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,11 @@
8989
<waitForPageLoad stepKey="waitForInvoicePageToLoad"/>
9090
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Invoice" stepKey="seeNewInvoiceInPageTitle" after="clickInvoiceButton"/>
9191
<see selector="{{AdminInvoiceTotalSection.total('Subtotal')}}" userInput="$150.00" stepKey="seeCorrectGrandTotal"/>
92-
<click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="clickSubmitInvoice"/>
92+
<actionGroup ref="AdminInvoiceClickSubmitActionGroup" stepKey="clickSubmitInvoice"/>
9393
<see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="The invoice has been created." stepKey="seeSuccessInvoiceMessage"/>
9494
<!--Create Shipment for the order-->
9595
<comment userInput="Create Shipment for the order" stepKey="createShipmentForOrder"/>
96-
<amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrdersPage2"/>
97-
<waitForPageLoad time="30" stepKey="waitForOrderListPageLoading"/>
96+
<actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="onOrdersPage2"/>
9897
<actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="openOrderPageForShip"/>
9998
<click selector="{{AdminOrderDetailsMainActionsSection.ship}}" stepKey="clickShipAction"/>
10099
<waitForPageLoad stepKey="waitForShipmentPagePage"/>

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@
3131
</after>
3232

3333
<!-- Create a bundle product -->
34-
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageBundle"/>
35-
<waitForPageLoad stepKey="waitForProductPageLoadBundle"/>
34+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="visitAdminProductPageBundle"/>
3635
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateBundleProduct">
3736
<argument name="product" value="BundleProduct"/>
3837
</actionGroup>

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,9 @@
4040
<amOnPage url="{{StorefrontProductPage.url($$createDynamicBundleProduct.name$$)}}" stepKey="amOnBundleProductPage"/>
4141
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoops"/>
4242
<!-- Search for the product by sku -->
43-
<fillField selector="{{StorefrontQuickSearchSection.searchPhrase}}" userInput="$$createDynamicBundleProduct.sku$$" stepKey="fillSearchBarByProductSku"/>
44-
<waitForPageLoad stepKey="waitForSearchButton"/>
45-
<click selector="{{StorefrontQuickSearchSection.searchButton}}" stepKey="clickSearchButton"/>
46-
<waitForPageLoad stepKey="waitForSearchResults"/>
43+
<actionGroup ref="StoreFrontQuickSearchActionGroup" stepKey="searchByCreatedTerm">
44+
<argument name="query" value="$$createDynamicBundleProduct.sku$$"/>
45+
</actionGroup>
4746
<!-- Should not see any search results -->
4847
<dontSee userInput="$$createDynamicBundleProduct.sku$$" selector="{{StorefrontCatalogSearchMainSection.searchResults}}" stepKey="dontSeeProduct"/>
4948
<see selector="{{StorefrontCatalogSearchMainSection.message}}" userInput="Your search returned no results." stepKey="seeCantFindProductOneMessage"/>

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,9 @@
3737
<amOnPage url="{{StorefrontProductPage.url($$createFixedBundleProduct.name$$)}}" stepKey="amOnBundleProductPage"/>
3838
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoops"/>
3939
<!-- Search for the product by sku -->
40-
<fillField selector="{{StorefrontQuickSearchSection.searchPhrase}}" userInput="$$createFixedBundleProduct.sku$$" stepKey="fillSearchBarByProductSku"/>
41-
<waitForPageLoad stepKey="waitForSearchButton"/>
42-
<click selector="{{StorefrontQuickSearchSection.searchButton}}" stepKey="clickSearchButton"/>
43-
<waitForPageLoad stepKey="waitForSearchResults"/>
40+
<actionGroup ref="StoreFrontQuickSearchActionGroup" stepKey="searchByCreatedTerm">
41+
<argument name="query" value="$$createFixedBundleProduct.sku$$"/>
42+
</actionGroup>
4443
<!-- Should not see any search results -->
4544
<dontSee userInput="$$createFixedBundleProduct.sku$$" selector="{{StorefrontCatalogSearchMainSection.searchResults}}" stepKey="dontSeeProduct"/>
4645
<see selector="{{StorefrontCatalogSearchMainSection.message}}" userInput="Your search returned no results." stepKey="seeCantFindProductOneMessage"/>

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@
3737
</after>
3838

3939
<!-- Create a bundle product -->
40-
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageBundle"/>
41-
<waitForPageLoad stepKey="waitForProductPageLoadBundle"/>
40+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="visitAdminProductPageBundle"/>
4241
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateBundleProduct">
4342
<argument name="product" value="BundleProduct"/>
4443
</actionGroup>

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@
3535
</after>
3636

3737
<!-- Create a bundle product -->
38-
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageBundle"/>
39-
<waitForPageLoad stepKey="waitForProductPageLoadBundle"/>
38+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="visitAdminProductPageBundle"/>
4039
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateBundleProduct">
4140
<argument name="product" value="BundleProduct"/>
4241
</actionGroup>

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@
7676
<seeElement stepKey="LookingForNameOfProduct" selector="{{StorefrontBundledSection.bundleProductName}}"/>
7777

7878
<!--Testing disabled view-->
79-
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="GoToProductCatalog"/>
80-
<waitForPageLoad stepKey="WaitForCatalogProductPageToLoad"/>
79+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="GoToProductCatalog"/>
8180
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="FindProductEditPage">
8281
<argument name="product" value="BundleProduct"/>
8382
</actionGroup>

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@
3535

3636
<!-- Create a product to appear in the widget, fill in basic info first -->
3737

38-
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductList"/>
39-
<waitForPageLoad stepKey="waitForProductList"/>
38+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="amOnProductList"/>
4039
<click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductToggle"/>
4140
<click selector="{{AdminProductGridActionSection.addBundleProduct}}" stepKey="clickAddBundleProduct"/>
4241
<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{_defaultProduct.name}}" stepKey="fillProductName"/>

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@
5353
</after>
5454

5555
<!-- Start creating a bundle product -->
56-
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductList"/>
57-
<waitForPageLoad stepKey="waitForProductList"/>
56+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="goToProductList"/>
5857
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct">
5958
<argument name="product" value="BundleProduct"/>
6059
</actionGroup>

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@
3131
</after>
3232

3333
<!-- Create a bundle product -->
34-
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageBundle"/>
35-
<waitForPageLoad stepKey="waitForProductPageLoadBundle"/>
34+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="visitAdminProductPageBundle"/>
3635
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateBundleProduct">
3736
<argument name="product" value="BundleProduct"/>
3837
</actionGroup>
@@ -84,8 +83,7 @@
8483
<grabTextFrom selector="{{CheckoutCartProductSection.nthBundleOptionName('1')}}" stepKey="grabTotalBefore"/>
8584

8685
<!-- Find the product that we just created using the product grid -->
87-
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/>
88-
<waitForPageLoad stepKey="waitForAdminProductPageLoad"/>
86+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="visitAdminProductPage"/>
8987
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/>
9088
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedProduct">
9189
<argument name="product" value="BundleProduct"/>

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@
3030
</after>
3131

3232
<!-- Start creating a bundle product -->
33-
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductList"/>
34-
<waitForPageLoad stepKey="waitForProductList"/>
33+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="goToProductList"/>
3534
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct">
3635
<argument name="product" value="BundleProduct"/>
3736
</actionGroup>

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@
3131
</after>
3232

3333
<!-- Start creating a bundle product -->
34-
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductList"/>
35-
<waitForPageLoad stepKey="waitForProductList"/>
34+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="goToProductList"/>
3635
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct">
3736
<argument name="product" value="BundleProduct"/>
3837
</actionGroup>

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@
3636
</after>
3737

3838
<!-- Start creating a bundle product -->
39-
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductList"/>
40-
<waitForPageLoad stepKey="waitForProductList"/>
39+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="goToProductList"/>
4140
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct">
4241
<argument name="product" value="BundleProduct"/>
4342
</actionGroup>

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@
3131
</after>
3232

3333
<!-- Create a bundle product -->
34-
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageBundle"/>
35-
<waitForPageLoad stepKey="waitForProductPageLoadBundle"/>
34+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="visitAdminProductPageBundle"/>
3635
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateBundleProduct">
3736
<argument name="product" value="BundleProduct"/>
3837
</actionGroup>
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\BundleGraphQl\Model\Resolver\Options;
9+
10+
use Magento\Framework\GraphQl\Config\Element\Field;
11+
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
12+
use Magento\Framework\GraphQl\Query\Resolver\ContextInterface;
13+
use Magento\Framework\GraphQl\Query\ResolverInterface;
14+
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
15+
16+
/**
17+
* Format new option uid in base64 encode for entered bundle options
18+
*/
19+
class BundleItemOptionUid implements ResolverInterface
20+
{
21+
/**
22+
* Option type name
23+
*/
24+
private const OPTION_TYPE = 'bundle';
25+
26+
/**
27+
* Create a option uid for entered option in "<option-type>/<option-id>/<option-value-id>/<quantity>" format
28+
*
29+
* @param Field $field
30+
* @param ContextInterface $context
31+
* @param ResolveInfo $info
32+
* @param array|null $value
33+
* @param array|null $args
34+
*
35+
* @return string
36+
*
37+
* @throws GraphQlInputException
38+
*
39+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
40+
*/
41+
public function resolve(
42+
Field $field,
43+
$context,
44+
ResolveInfo $info,
45+
array $value = null,
46+
array $args = null
47+
) {
48+
if (!isset($value['option_id']) || empty($value['option_id'])) {
49+
throw new GraphQlInputException(__('"option_id" value should be specified.'));
50+
}
51+
52+
if (!isset($value['selection_id']) || empty($value['selection_id'])) {
53+
throw new GraphQlInputException(__('"selection_id" value should be specified.'));
54+
}
55+
56+
$optionDetails = [
57+
self::OPTION_TYPE,
58+
$value['option_id'],
59+
$value['selection_id'],
60+
(int) $value['selection_qty']
61+
];
62+
63+
$content = implode('/', $optionDetails);
64+
65+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
66+
return base64_encode($content);
67+
}
68+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ type BundleItemOption @doc(description: "BundleItemOption defines characteristic
6666
price_type: PriceTypeEnum @doc(description: "One of FIXED, PERCENT, or DYNAMIC.")
6767
can_change_quantity: Boolean @doc(description: "Indicates whether the customer can change the number of items for this option.")
6868
product: ProductInterface @doc(description: "Contains details about this product option.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product")
69+
uid: ID! @doc(description: "A string that encodes option details.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Options\\BundleItemOptionUid") # A Base64 string that encodes option details.
6970
}
7071

7172
type BundleProduct implements ProductInterface, PhysicalProductInterface, CustomizableProductInterface @doc(description: "BundleProduct defines basic features of a bundle product and contains multiple BundleItems.") {

app/code/Magento/Catalog/Model/Category.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class Category extends \Magento\Catalog\Model\AbstractModel implements
8787
*
8888
* @var string
8989
*/
90-
protected $_cacheTag = self::CACHE_TAG;
90+
protected $_cacheTag = false;
9191

9292
/**
9393
* URL Model instance
@@ -1111,6 +1111,17 @@ public function afterSave()
11111111
return $result;
11121112
}
11131113

1114+
/**
1115+
* @inheritDoc
1116+
*/
1117+
public function getCacheTags()
1118+
{
1119+
$identities = $this->getIdentities();
1120+
$cacheTags = !empty($identities) ? (array) $identities : parent::getCacheTags();
1121+
1122+
return $cacheTags;
1123+
}
1124+
11141125
/**
11151126
* Init indexing process after category save
11161127
*

app/code/Magento/Catalog/Model/Product.php

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
use Magento\Catalog\Api\ProductLinkRepositoryInterface;
1212
use Magento\Catalog\Model\Product\Attribute\Backend\Media\EntryConverterPool;
1313
use Magento\Catalog\Model\Product\Configuration\Item\Option\OptionInterface;
14-
use Magento\Catalog\Model\FilterProductCustomAttribute;
1514
use Magento\Framework\Api\AttributeValueFactory;
1615
use Magento\Framework\App\Filesystem\DirectoryList;
1716
use Magento\Framework\App\ObjectManager;
@@ -977,6 +976,17 @@ public function afterSave()
977976
return $result;
978977
}
979978

979+
/**
980+
* @inheritDoc
981+
*/
982+
public function getCacheTags()
983+
{
984+
$identities = $this->getIdentities();
985+
$cacheTags = !empty($identities) ? (array) $identities : parent::getCacheTags();
986+
987+
return $cacheTags;
988+
}
989+
980990
/**
981991
* Set quantity for product
982992
*
@@ -2158,7 +2168,7 @@ public function reset()
21582168
*/
21592169
public function getCacheIdTags()
21602170
{
2161-
// phpstan:ignore
2171+
// phpstan:ignore "Call to an undefined static method"
21622172
$tags = parent::getCacheIdTags();
21632173
$affectedCategoryIds = $this->getAffectedCategoryIds();
21642174
if (!$affectedCategoryIds) {
@@ -2339,7 +2349,8 @@ public function isDisabled()
23392349
public function getImage()
23402350
{
23412351
$this->getTypeInstance()->setImageFromChildProduct($this);
2342-
// phpstan:ignore
2352+
2353+
// phpstan:ignore "Call to an undefined static method"
23432354
return parent::getImage();
23442355
}
23452356

@@ -2403,6 +2414,8 @@ public function reloadPriceInfo()
24032414
}
24042415
}
24052416

2417+
//phpcs:disable PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.MethodDoubleUnderscore
2418+
24062419
/**
24072420
* Return Data Object data in array format.
24082421
*
@@ -2430,6 +2443,8 @@ public function __toArray() //phpcs:ignore PHPCompatibility.FunctionNameRestrict
24302443
return $data;
24312444
}
24322445

2446+
//phpcs:enable PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.MethodDoubleUnderscore
2447+
24332448
/**
24342449
* Convert Category model into flat array.
24352450
*

0 commit comments

Comments
 (0)