Skip to content

Commit 3ef13dd

Browse files
committed
Merge remote-tracking branch 'mainline/2.4-develop' into ACP2E-741
2 parents 693adf1 + b092dd6 commit 3ef13dd

File tree

50 files changed

+1382
-228
lines changed

Some content is hidden

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

50 files changed

+1382
-228
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/Block/Product/Compare/ListCompare.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ class ListCompare extends \Magento\Catalog\Block\Product\AbstractProduct
4040
protected $_useLinkForAsLowAs = false;
4141

4242
/**
43-
* Customer id
44-
*
4543
* @var null|int
4644
*/
4745
protected $_customerId = null;
@@ -52,22 +50,16 @@ class ListCompare extends \Magento\Catalog\Block\Product\AbstractProduct
5250
protected $httpContext;
5351

5452
/**
55-
* Customer visitor
56-
*
5753
* @var \Magento\Customer\Model\Visitor
5854
*/
5955
protected $_customerVisitor;
6056

6157
/**
62-
* Catalog product visibility
63-
*
6458
* @var \Magento\Catalog\Model\Product\Visibility
6559
*/
6660
protected $_catalogProductVisibility;
6761

6862
/**
69-
* Item collection factory
70-
*
7163
* @var \Magento\Catalog\Model\ResourceModel\Product\Compare\Item\CollectionFactory
7264
*/
7365
protected $_itemCollectionFactory;
@@ -205,6 +197,9 @@ public function getProductAttributeValue($product, $attribute)
205197
} else {
206198
$value = $product->getData($attribute->getAttributeCode());
207199
}
200+
if (is_array($value)) {
201+
return __('N/A');
202+
}
208203
return (string)$value == '' ? __('No') : $value;
209204
}
210205

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>

0 commit comments

Comments
 (0)