Skip to content

Commit 192d2e8

Browse files
committed
Merge remote-tracking branch 'origin/2.4-develop' into AC-2794
2 parents 7e7bf55 + b092dd6 commit 192d2e8

File tree

34 files changed

+883
-103
lines changed

34 files changed

+883
-103
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 0 additions & 43 deletions
This file was deleted.
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Bug report
2+
description: Technical issue with the Magento 2 core components
3+
body:
4+
- type: markdown
5+
attributes:
6+
value: |
7+
Please read [our guidelines](https://developer.adobe.com/commerce/contributor/guides/code-contributions/#report-an-issue) before submitting the issue.
8+
- type: textarea
9+
attributes:
10+
label: Preconditions and environment
11+
description: |
12+
Describe your environment.
13+
Provide all the details that will help us to reproduce the bug.
14+
value: |
15+
- Magento version
16+
- Anything else that would help a developer reproduce the bug
17+
- type: textarea
18+
attributes:
19+
label: Steps to reproduce
20+
description: |
21+
Provide a set of clear steps to reproduce this bug.
22+
placeholder: |
23+
Example:
24+
1. Navigate to storefront as a guest.
25+
2. Open Test Category.
26+
3. Click “Add to Cart” on the Virtual Product.
27+
4. Open mini shopping cart and click “Proceed to Checkout”.
28+
validations:
29+
required: true
30+
- type: textarea
31+
attributes:
32+
label: Expected result
33+
description: |
34+
Tell us what you expected to happen.
35+
placeholder: |
36+
Example:
37+
Order is placed successfully, customer is redirected to the success page.
38+
validations:
39+
required: true
40+
- type: textarea
41+
attributes:
42+
label: Actual result
43+
description: |
44+
Tell us what happened. Include error messages and issues.
45+
placeholder: |
46+
Example:
47+
“Place order” button is not visible, order cannot be placed.
48+
validations:
49+
required: true
50+
- type: textarea
51+
attributes:
52+
label: Additional information
53+
description: |
54+
Additional information is often requested when the bug report is processed. You can save time by providing both Magento and browser logs, screenshots, repository branch and HEAD commit you checked out to install Magento and any other artifacts related to the issue.
55+
Also, links to the comments with important information, Root Cause analysis, additional video recordings; and anything else that is important for the issue and at some reason cannot be added to other sections.
56+
- type: textarea
57+
attributes:
58+
label: Release note
59+
description: |
60+
Help us to provide meaningful release notes to the community.
61+
- type: checkboxes
62+
attributes:
63+
label: Triage and priority
64+
description: |
65+
Provide [Severity](https://developer.adobe.com/commerce/contributor/guides/code-contributions/#community-backlog-priority) assessment for the Issue as a Reporter.
66+
This information helps us during the Confirmation and Issue triage processes.
67+
options:
68+
- label: 'Severity: **S0** _- Affects critical data or functionality and leaves users without workaround._'
69+
- label: 'Severity: **S1** _- Affects critical data or functionality and forces users to employ a workaround._'
70+
- label: 'Severity: **S2** _- Affects non-critical data or functionality and forces users to employ a workaround._'
71+
- label: 'Severity: **S3** _- Affects non-critical data or functionality and does not force users to employ a workaround._'
72+
- label: 'Severity: **S4** _- Affects aesthetics, professional look and feel, “quality” or “usability”._'

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Magento values the contributions of the security research community, and we look
44

55
## Where should I report security issues?
66

7-
We strongly encourage you to report all security issues privately via our [bug bounty program](https://hackerone.com/magento). Please provide us with relevant technical details and repro steps to expedite our investigation. If you prefer not to use HackerOne, email us directly at `psirt@adobe.com` with details and repro steps.
7+
We strongly encourage you to report all security issues privately via our [bug bounty program](https://hackerone.com/adobe). Please provide us with relevant technical details and repro steps to expedite our investigation. If you prefer not to use HackerOne, email us directly at `psirt@adobe.com` with details and repro steps.
88

99
## Learning More About Security
1010
To learn more about securing a Magento store, please visit the [Security Center](https://magento.com/security).
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
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\Bundle\Test\Fixture;
9+
10+
use Magento\Framework\DataObject;
11+
use Magento\Sales\Api\OrderRepositoryInterface;
12+
use Magento\TestFramework\Fixture\Api\DataMerger;
13+
use Magento\TestFramework\Fixture\Api\ServiceFactory;
14+
use Magento\TestFramework\Fixture\Data\ProcessorInterface;
15+
use Magento\TestFramework\Fixture\RevertibleDataFixtureInterface;
16+
17+
class OrderItem implements RevertibleDataFixtureInterface
18+
{
19+
private const DEFAULT_DATA = [
20+
'items' => [
21+
['sku' => '%uniqid%']
22+
],
23+
'payment'=> [ 'method' => 'checkmo']
24+
];
25+
26+
/**
27+
* @var ServiceFactory
28+
*/
29+
private ServiceFactory $serviceFactory;
30+
31+
/**
32+
* @var ProcessorInterface
33+
*/
34+
private ProcessorInterface $dataProcessor;
35+
36+
/**
37+
* @var DataMerger
38+
*/
39+
private DataMerger $dataMerger;
40+
41+
/**
42+
* @param ServiceFactory $serviceFactory
43+
* @param ProcessorInterface $dataProcessor
44+
* @param DataMerger $dataMerger
45+
*/
46+
public function __construct(
47+
ServiceFactory $serviceFactory,
48+
ProcessorInterface $dataProcessor,
49+
DataMerger $dataMerger
50+
) {
51+
$this->serviceFactory = $serviceFactory;
52+
$this->dataProcessor = $dataProcessor;
53+
$this->dataMerger = $dataMerger;
54+
}
55+
56+
/**
57+
* @param array $data
58+
* @return DataObject|null
59+
*/
60+
public function apply(array $data = []): ?DataObject
61+
{
62+
$service = $this->serviceFactory->create(OrderRepositoryInterface::class, 'save');
63+
64+
return $service->execute(['entity' => $this->prepareData($data)]);
65+
}
66+
67+
/**
68+
* @inheritdoc
69+
*/
70+
public function revert(DataObject $data): void
71+
{
72+
$service = $this->serviceFactory->create(OrderRepositoryInterface::class, 'delete');
73+
74+
$service->execute(['entity' => $data]);
75+
}
76+
77+
/**
78+
* Prepare product data
79+
*
80+
* @param array $data
81+
* @return array
82+
*/
83+
private function prepareData(array $data): array
84+
{
85+
$data = $this->dataMerger->merge(self::DEFAULT_DATA, $data, false);
86+
87+
return $this->dataProcessor->process($this, $data);
88+
}
89+
}

app/code/Magento/Catalog/Test/Mftf/Data/ImageContentData.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,8 @@
4343
<entity name="MagentoPlaceHolderImageContent" type="ImageContent">
4444
<data key="baseImage_md5">c0459a796c5b8ee74254472c235a7460</data>
4545
</entity>
46+
<entity name="TestImageWithDotInFilenameImageContent" extends="MagentoLogoImageContent" type="ImageContent">
47+
<data key="baseImage_md5">4aa2a3c3eefd29898585a8dd781e5bfd</data>
48+
<data key="name" unique="prefix">m.agento-logo.png</data>
49+
</entity>
4650
</entities>

app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,11 @@
431431
<data key="file">test_image.jpg</data>
432432
<data key="filename">test_image</data>
433433
</entity>
434+
<entity name="TestImageWithDotInFilename" extends="MagentoLogo" type="image">
435+
<data key="title" unique="suffix">TestImageWithDotInFilename</data>
436+
<data key="file">m.agento-logo.png</data>
437+
<data key="filename">m.agento-logo</data>
438+
</entity>
434439
<entity name="ProductWithUnicode" type="product">
435440
<data key="name" unique="suffix">&#38657;&#20135;&#21697;</data>
436441
<data key="sku" unique="suffix">&#38657;&#20135;&#21697;</data>
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="StorefrontProductImageWithDotTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="Product Image"/>
15+
<title value="Product image with dot in filename should be visible on frontend after catalog image cache flush"/>
16+
<description value="Product image with dot in filename should be visible on frontend after catalog image cache flush"/>
17+
<group value="Catalog"/>
18+
<severity value="AVERAGE"/>
19+
</annotations>
20+
<before>
21+
<magentoCLI command="config:set system/upload_configuration/enable_resize 0" stepKey="disableImageResizing"/>
22+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
23+
</before>
24+
<after>
25+
<magentoCLI command="config:set system/upload_configuration/enable_resize 1" stepKey="enableImageResizing"/>
26+
<actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct">
27+
<argument name="sku" value="{{SimpleProduct.sku}}"/>
28+
</actionGroup>
29+
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/>
30+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAsAdmin"/>
31+
</after>
32+
33+
<!--Create product-->
34+
<actionGroup ref="AdminOpenNewProductFormPageActionGroup" stepKey="openNewProductPage"/>
35+
<actionGroup ref="FillMainProductFormActionGroup" stepKey="fillSimpleProductMain">
36+
<argument name="product" value="SimpleProduct"/>
37+
</actionGroup>
38+
39+
<!-- Add image to product -->
40+
<actionGroup ref="AddProductImageActionGroup" stepKey="addImageForSimpleProduct">
41+
<argument name="image" value="TestImageWithDotInFilename"/>
42+
</actionGroup>
43+
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveSimpleProduct"/>
44+
45+
<!-- Flush catalog image cache -->
46+
<actionGroup ref="AdminGoToCacheManagementPageActionGroup" stepKey="goToCacheManagementPage"/>
47+
<actionGroup ref="AdminClickFlushCatalogImagesCacheActionGroup" stepKey="clearCatalogImageCache"/>
48+
49+
<!-- Assert product in storefront product page -->
50+
<actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="assertProductInStorefrontProductPage">
51+
<argument name="product" value="SimpleProduct"/>
52+
</actionGroup>
53+
54+
<!-- Assert product image in storefront product page -->
55+
<grabAttributeFrom userInput="src" selector="{{StorefrontProductMediaSection.imageFile(TestImageWithDotInFilename.filename)}}" stepKey="productImageURL"/>
56+
<helper class="Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertImageContentIsEqual" stepKey="assertProductImageEqualToOriginalImage">
57+
<argument name="url">{$productImageURL}</argument>
58+
<argument name="expectedString">{{TestImageWithDotInFilenameImageContent.baseImage_md5}}</argument>
59+
<argument name="message">Url: "{$productImageURL}" did not render image: {{TestImageWithDotInFilename.file}}</argument>
60+
</helper>
61+
</test>
62+
</tests>

app/code/Magento/CatalogInventory/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@
2828
"Magento\\CatalogInventory\\": ""
2929
}
3030
},
31-
"abandoned": "magento/inventory-composer-metapackage"
31+
"abandoned": "magento/inventory-metapackage"
3232
}

app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/Product/Price/Provider.php

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77

88
namespace Magento\ConfigurableProductGraphQl\Model\Resolver\Product\Price;
99

10+
use Magento\Catalog\Model\Product\Attribute\Source\Status as ProductStatus;
1011
use Magento\Catalog\Pricing\Price\FinalPrice;
1112
use Magento\Catalog\Pricing\Price\RegularPrice;
12-
use Magento\Framework\Pricing\Amount\AmountInterface;
13-
use Magento\Framework\Pricing\SaleableInterface;
1413
use Magento\CatalogGraphQl\Model\Resolver\Product\Price\ProviderInterface;
1514
use Magento\ConfigurableProduct\Pricing\Price\ConfigurableOptionsProviderInterface;
15+
use Magento\Framework\Pricing\Amount\AmountInterface;
16+
use Magento\Framework\Pricing\SaleableInterface;
1617

1718
/**
1819
* Provides product prices for configurable products
@@ -100,7 +101,7 @@ private function getMinimalPrice(SaleableInterface $product, string $code): Amou
100101
{
101102
if (!isset($this->minimalPrice[$code][$product->getId()])) {
102103
$minimumAmount = null;
103-
foreach ($this->optionsProvider->getProducts($product) as $variant) {
104+
foreach ($this->filterDisabledProducts($this->optionsProvider->getProducts($product)) as $variant) {
104105
$variantAmount = $variant->getPriceInfo()->getPrice($code)->getAmount();
105106
if (!$minimumAmount || ($variantAmount->getValue() < $minimumAmount->getValue())) {
106107
$minimumAmount = $variantAmount;
@@ -134,4 +135,17 @@ private function getMaximalPrice(SaleableInterface $product, string $code): Amou
134135

135136
return $this->maximalPrice[$code][$product->getId()];
136137
}
138+
139+
/**
140+
* Filter out disabled products
141+
*
142+
* @param array $products
143+
* @return array
144+
*/
145+
private function filterDisabledProducts(array $products): array
146+
{
147+
return array_filter($products, function ($product) {
148+
return (int)$product->getStatus() === ProductStatus::STATUS_ENABLED;
149+
});
150+
}
137151
}

app/code/Magento/LoginAsCustomerAdminUi/Block/Adminhtml/ConfirmationPopup.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ public function getJsLayout()
8282

8383
$layout['components']['lac-confirmation-popup']['showStoreViewOptions'] = $showStoreViewOptions;
8484
$layout['components']['lac-confirmation-popup']['storeViewOptions'] = $showStoreViewOptions
85-
? $this->options->toOptionArray()
86-
: [];
85+
? (($this->_request->getParam('id') || $this->_request->getParam('order_id'))
86+
? $this->options->toOptionArray() : []) : [];
8787

8888
return $this->json->serialize($layout);
8989
}

0 commit comments

Comments
 (0)