Skip to content

Commit 855585d

Browse files
Merge branch 'MCP-996' of github.com:magento-performance/magento2ce into MCP-996
2 parents f9cb8ad + 00348e5 commit 855585d

File tree

219 files changed

+5798
-1767
lines changed

Some content is hidden

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

219 files changed

+5798
-1767
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).

app/code/Magento/AdminNotification/Model/Feed.php

Lines changed: 53 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,22 @@
55
*/
66
namespace Magento\AdminNotification\Model;
77

8-
use Magento\Framework\Escaper;
8+
use Magento\AdminNotification\Model\InboxFactory;
9+
use Magento\Backend\App\ConfigInterface;
10+
use Magento\Framework\App\DeploymentConfig;
911
use Magento\Framework\App\ObjectManager;
12+
use Magento\Framework\App\ProductMetadataInterface;
1013
use Magento\Framework\Config\ConfigOptionsListConstants;
14+
use Magento\Framework\Data\Collection\AbstractDb;
15+
use Magento\Framework\Escaper;
16+
use Magento\Framework\HTTP\Adapter\Curl;
17+
use Magento\Framework\HTTP\Adapter\CurlFactory;
18+
use Magento\Framework\Model\AbstractModel;
19+
use Magento\Framework\Model\Context;
20+
use Magento\Framework\Model\ResourceModel\AbstractResource;
21+
use Magento\Framework\Registry;
22+
use Magento\Framework\UrlInterface;
23+
use SimpleXMLElement;
1124

1225
/**
1326
* AdminNotification Feed model
@@ -16,87 +29,85 @@
1629
* @api
1730
* @since 100.0.2
1831
*/
19-
class Feed extends \Magento\Framework\Model\AbstractModel
32+
class Feed extends AbstractModel
2033
{
21-
const XML_USE_HTTPS_PATH = 'system/adminnotification/use_https';
34+
public const XML_USE_HTTPS_PATH = 'system/adminnotification/use_https';
2235

23-
const XML_FEED_URL_PATH = 'system/adminnotification/feed_url';
36+
public const XML_FEED_URL_PATH = 'system/adminnotification/feed_url';
2437

25-
const XML_FREQUENCY_PATH = 'system/adminnotification/frequency';
38+
public const XML_FREQUENCY_PATH = 'system/adminnotification/frequency';
2639

27-
const XML_LAST_UPDATE_PATH = 'system/adminnotification/last_update';
40+
public const XML_LAST_UPDATE_PATH = 'system/adminnotification/last_update';
2841

2942
/**
3043
* @var Escaper
3144
*/
3245
private $escaper;
3346

3447
/**
35-
* Feed url
36-
*
3748
* @var string
3849
*/
3950
protected $_feedUrl;
4051

4152
/**
42-
* @var \Magento\Backend\App\ConfigInterface
53+
* @var ConfigInterface
4354
*/
4455
protected $_backendConfig;
4556

4657
/**
47-
* @var \Magento\AdminNotification\Model\InboxFactory
58+
* @var InboxFactory
4859
*/
4960
protected $_inboxFactory;
5061

5162
/**
52-
* @var \Magento\Framework\HTTP\Adapter\CurlFactory
63+
* @var CurlFactory
5364
*
5465
*/
5566
protected $curlFactory;
5667

5768
/**
5869
* Deployment configuration
5970
*
60-
* @var \Magento\Framework\App\DeploymentConfig
71+
* @var DeploymentConfig
6172
*/
6273
protected $_deploymentConfig;
6374

6475
/**
65-
* @var \Magento\Framework\App\ProductMetadataInterface
76+
* @var ProductMetadataInterface
6677
*/
6778
protected $productMetadata;
6879

6980
/**
70-
* @var \Magento\Framework\UrlInterface
81+
* @var UrlInterface
7182
*/
7283
protected $urlBuilder;
7384

7485
/**
75-
* @param \Magento\Framework\Model\Context $context
76-
* @param \Magento\Framework\Registry $registry
77-
* @param \Magento\Backend\App\ConfigInterface $backendConfig
86+
* @param Context $context
87+
* @param Registry $registry
88+
* @param ConfigInterface $backendConfig
7889
* @param InboxFactory $inboxFactory
79-
* @param \Magento\Framework\HTTP\Adapter\CurlFactory $curlFactory
80-
* @param \Magento\Framework\App\DeploymentConfig $deploymentConfig
81-
* @param \Magento\Framework\App\ProductMetadataInterface $productMetadata
82-
* @param \Magento\Framework\UrlInterface $urlBuilder
83-
* @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource
84-
* @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection
90+
* @param CurlFactory $curlFactory
91+
* @param DeploymentConfig $deploymentConfig
92+
* @param ProductMetadataInterface $productMetadata
93+
* @param UrlInterface $urlBuilder
94+
* @param AbstractResource|null $resource
95+
* @param AbstractDb|null $resourceCollection
8596
* @param array $data
8697
* @param Escaper|null $escaper
8798
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
8899
*/
89100
public function __construct(
90-
\Magento\Framework\Model\Context $context,
91-
\Magento\Framework\Registry $registry,
92-
\Magento\Backend\App\ConfigInterface $backendConfig,
93-
\Magento\AdminNotification\Model\InboxFactory $inboxFactory,
94-
\Magento\Framework\HTTP\Adapter\CurlFactory $curlFactory,
95-
\Magento\Framework\App\DeploymentConfig $deploymentConfig,
96-
\Magento\Framework\App\ProductMetadataInterface $productMetadata,
97-
\Magento\Framework\UrlInterface $urlBuilder,
98-
\Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
99-
\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
101+
Context $context,
102+
Registry $registry,
103+
ConfigInterface $backendConfig,
104+
InboxFactory $inboxFactory,
105+
CurlFactory $curlFactory,
106+
DeploymentConfig $deploymentConfig,
107+
ProductMetadataInterface $productMetadata,
108+
UrlInterface $urlBuilder,
109+
AbstractResource $resource = null,
110+
AbstractDb $resourceCollection = null,
100111
array $data = [],
101112
Escaper $escaper = null
102113
) {
@@ -210,10 +221,11 @@ public function setLastUpdate()
210221
/**
211222
* Retrieve feed data as XML element
212223
*
213-
* @return \SimpleXMLElement
224+
* @return SimpleXMLElement
214225
*/
215226
public function getFeedData()
216227
{
228+
/** @var Curl $curl */
217229
$curl = $this->curlFactory->create();
218230
$curl->setConfig(
219231
[
@@ -227,11 +239,11 @@ public function getFeedData()
227239
$curl->write(\Zend_Http_Client::GET, $this->getFeedUrl(), '1.0');
228240
$data = $curl->read();
229241
$data = preg_split('/^\r?$/m', $data, 2);
230-
$data = trim($data[1]);
242+
$data = trim($data[1] ?? '');
231243
$curl->close();
232244

233245
try {
234-
$xml = new \SimpleXMLElement($data);
246+
$xml = new SimpleXMLElement($data);
235247
} catch (\Exception $e) {
236248
return false;
237249
}
@@ -242,15 +254,15 @@ public function getFeedData()
242254
/**
243255
* Retrieve feed as XML element
244256
*
245-
* @return \SimpleXMLElement
257+
* @return SimpleXMLElement
246258
*/
247259
public function getFeedXml()
248260
{
249261
try {
250262
$data = $this->getFeedData();
251-
$xml = new \SimpleXMLElement($data);
263+
$xml = new SimpleXMLElement($data);
252264
} catch (\Exception $e) {
253-
$xml = new \SimpleXMLElement('<?xml version="1.0" encoding="utf-8" ?>');
265+
$xml = new SimpleXMLElement('<?xml version="1.0" encoding="utf-8" ?>');
254266
}
255267

256268
return $xml;
@@ -259,10 +271,10 @@ public function getFeedXml()
259271
/**
260272
* Converts incoming data to string format and escapes special characters.
261273
*
262-
* @param \SimpleXMLElement $data
274+
* @param SimpleXMLElement $data
263275
* @return string
264276
*/
265-
private function escapeString(\SimpleXMLElement $data)
277+
private function escapeString(SimpleXMLElement $data)
266278
{
267279
return $this->escaper->escapeHtml((string)$data);
268280
}

app/code/Magento/AdminNotification/view/adminhtml/templates/toolbar_entry.phtml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,16 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
7-
/** @var $this \Magento\AdminNotification\Block\ToolbarEntry */
8-
6+
// phpcs:disable Generic.Files.LineLength
7+
/** @var $block \Magento\AdminNotification\Block\ToolbarEntry */
98
$notificationCount = $block->getUnreadNotificationCount();
109
$notificationCounterMax = $block->getNotificationCounterMax();
1110
?>
1211
<div
1312
data-mage-init='{"toolbarEntry": {}}'
1413
class="notifications-wrapper admin__action-dropdown-wrap"
1514
data-notification-count="<?= (int)$notificationCount ?>">
16-
<?php if ($notificationCount > 0) : ?>
15+
<?php if ($notificationCount > 0): ?>
1716
<a
1817
href="<?= $block->escapeUrl($block->getUrl('adminhtml/notification/index')) ?>"
1918
class="notifications-action admin__action-dropdown"
@@ -27,19 +26,19 @@
2726
<ul
2827
class="admin__action-dropdown-menu"
2928
data-mark-as-read-url="<?= $block->escapeUrl($block->getUrl('adminhtml/notification/ajaxMarkAsRead')) ?>">
30-
<?php foreach ($block->getLatestUnreadNotifications() as $notification) : ?>
29+
<?php foreach ($block->getLatestUnreadNotifications() as $notification): ?>
3130
<?php /** @var $notification \Magento\AdminNotification\Model\Inbox */ ?>
32-
<li class="notifications-entry<?php if ($notification->getSeverity() == 1) : ?> notifications-critical<?php endif; ?>"
31+
<li class="notifications-entry<?php if ($notification->getSeverity() == 1): ?> notifications-critical<?php endif; ?>"
3332
data-notification-id="<?= $block->escapeHtmlAttr($notification->getId()) ?>"
34-
data-notification-severity="<?php if ($notification->getSeverity() == 1) : ?>1<?php endif; ?>">
33+
data-notification-severity="<?php if ($notification->getSeverity() == 1): ?>1<?php endif; ?>">
3534
<?php
36-
$notificationDescription = $notification->getDescription();
35+
$notificationDescription = $notification->getDescription() ?? '';
3736
$notificationDescriptionLength = $block->getNotificationDescriptionLength();
3837
?>
3938
<strong class="notifications-entry-title">
4039
<?= $block->escapeHtml($notification->getTitle()) ?>
4140
</strong>
42-
<?php if (strlen($notificationDescription) > $notificationDescriptionLength) : ?>
41+
<?php if (strlen($notificationDescription) > $notificationDescriptionLength): ?>
4342
<p class="notifications-entry-description _cutted">
4443
<span class="notifications-entry-description-start">
4544
<?= $block->escapeHtml(substr($notificationDescription, 0, $notificationDescriptionLength)) ?>
@@ -48,7 +47,7 @@
4847
<?= $block->escapeHtml(substr($notificationDescription, $notificationDescriptionLength)) ?>
4948
</span>
5049
</p>
51-
<?php else : ?>
50+
<?php else: ?>
5251
<p class="notifications-entry-description">
5352
<?= $block->escapeHtml($notificationDescription) ?>
5453
</p>
@@ -71,7 +70,7 @@
7170
</a>
7271
</li>
7372
</ul>
74-
<?php else : ?>
73+
<?php else: ?>
7574
<a
7675
class="notifications-action admin__action-dropdown"
7776
href="<?= $block->escapeUrl($block->getUrl('adminhtml/notification/index')) ?>"

0 commit comments

Comments
 (0)