Skip to content

Commit 160273f

Browse files
authored
Merge branch '2.4-develop' into add-immutable
2 parents 4433f96 + 84505ca commit 160273f

File tree

688 files changed

+151753
-3119
lines changed

Some content is hidden

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

688 files changed

+151753
-3119
lines changed

app/bootstrap.php

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@
1313
}
1414
#ini_set('display_errors', 1);
1515

16-
/* PHP version validation */
17-
if (!defined('PHP_VERSION_ID') || PHP_VERSION_ID < 80100) {
18-
if (PHP_SAPI == 'cli') {
16+
if (PHP_VERSION_ID < 80100) {
17+
if (PHP_SAPI === 'cli') {
1918
echo 'Magento supports PHP 8.1.0 or later. ' .
2019
'Please read https://experienceleague.adobe.com/docs/commerce-operations/installation-guide/system-requirements.html';
2120
} else {
@@ -31,16 +30,6 @@
3130
exit(1);
3231
}
3332

34-
// PHP 8 compatibility. Define constants that are not present in PHP < 8.0
35-
if (!defined('PHP_VERSION_ID') || PHP_VERSION_ID < 80000) {
36-
if (!defined('T_NAME_QUALIFIED')) {
37-
define('T_NAME_QUALIFIED', 24001);
38-
}
39-
if (!defined('T_NAME_FULLY_QUALIFIED')) {
40-
define('T_NAME_FULLY_QUALIFIED', 24002);
41-
}
42-
}
43-
4433
require_once __DIR__ . '/autoload.php';
4534
// Sets default autoload mappings, may be overridden in Bootstrap::create
4635
\Magento\Framework\App\Bootstrap::populateAutoloader(BP, []);

app/code/Magento/AdminNotification/Controller/Adminhtml/Notification/Index.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
namespace Magento\AdminNotification\Controller\Adminhtml\Notification;
77

88
use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface;
9+
use Magento\Framework\View\Result\Page;
910

1011
class Index extends \Magento\AdminNotification\Controller\Adminhtml\Notification implements HttpGetActionInterface
1112
{
@@ -14,14 +15,14 @@ class Index extends \Magento\AdminNotification\Controller\Adminhtml\Notification
1415
*/
1516
public function execute()
1617
{
17-
$this->_view->loadLayout();
18-
$this->_setActiveMenu(
19-
'Magento_AdminNotification::system_adminnotification'
20-
)->_addBreadcrumb(
18+
/** @var Page $resultPage */
19+
$resultPage = $this->resultFactory->create(\Magento\Framework\Controller\ResultFactory::TYPE_PAGE);
20+
$resultPage->setActiveMenu('Magento_AdminNotification::system_adminnotification');
21+
$resultPage->addBreadcrumb(
2122
__('Messages Inbox'),
2223
__('Messages Inbox')
2324
);
24-
$this->_view->getPage()->getConfig()->getTitle()->prepend(__('Notifications'));
25-
return $this->_view->renderLayout();
25+
$resultPage->getConfig()->getTitle()->prepend(__('Notifications'));
26+
return $resultPage;
2627
}
2728
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
/**
3+
* Copyright 2025 Adobe
4+
* All Rights Reserved.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\AdvancedSearch\Model\Client;
9+
10+
class ClientException extends \Exception
11+
{
12+
13+
}

app/code/Magento/Backend/Block/Template.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ public function __construct(
8080
$this->formKey = $context->getFormKey();
8181
$this->nameBuilder = $context->getNameBuilder();
8282
$data['jsonHelper'] = $jsonHelper ?? ObjectManager::getInstance()->get(JsonHelper::class);
83-
$data['directoryHelper']= $directoryHelper ?? ObjectManager::getInstance()->get(DirectoryHelper::class);
83+
if (empty($data['directoryHelper'])) {
84+
$data['directoryHelper'] = $directoryHelper ?? ObjectManager::getInstance()->get(DirectoryHelper::class);
85+
}
8486
parent::__construct($context, $data);
8587
}
8688

@@ -107,6 +109,7 @@ public function getFormKey()
107109
* not be used in future development. Module design should explicitly state dependencies to avoid requiring output
108110
* disabling. This functionality will temporarily be kept in Magento core, as there are unresolved modularity
109111
* issues that will be addressed in future releases.
112+
* @see no alternatives
110113
*/
111114
public function isOutputEnabled($moduleName = null)
112115
{

app/code/Magento/Backend/Controller/Adminhtml/System/Store/Save.php

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
*/
66
namespace Magento\Backend\Controller\Adminhtml\System\Store;
77

8+
use Magento\Backend\App\Action\Context;
9+
use Magento\Backend\Model\View\Result\ForwardFactory;
10+
use Magento\Framework\App\Cache\TypeListInterface;
11+
use Magento\Framework\Filter\FilterManager;
12+
use Magento\Framework\Registry;
13+
use Magento\Framework\View\Result\PageFactory;
814
use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface;
915
use Magento\Store\Model\Group as StoreGroup;
1016
use Magento\Store\Model\Store;
@@ -17,6 +23,32 @@
1723
*/
1824
class Save extends \Magento\Backend\Controller\Adminhtml\System\Store implements HttpPostActionInterface
1925
{
26+
/**
27+
* @var TypeListInterface
28+
*/
29+
private $cacheTypeList;
30+
31+
/**
32+
* Constructor
33+
*
34+
* @param Context $context
35+
* @param Registry $coreRegistry
36+
* @param FilterManager $filterManager
37+
* @param ForwardFactory $resultForwardFactory
38+
* @param PageFactory $resultPageFactory
39+
* @param TypeListInterface $cacheTypeList
40+
*/
41+
public function __construct(
42+
Context $context,
43+
Registry $coreRegistry,
44+
FilterManager $filterManager,
45+
ForwardFactory $resultForwardFactory,
46+
PageFactory $resultPageFactory,
47+
TypeListInterface $cacheTypeList,
48+
) {
49+
parent::__construct($context, $coreRegistry, $filterManager, $resultForwardFactory, $resultPageFactory);
50+
$this->cacheTypeList = $cacheTypeList;
51+
}
2052
/**
2153
* Process Website model save
2254
*
@@ -67,6 +99,8 @@ private function processStoreSave($postData)
6799
if ($postData['store']['store_id']) {
68100
$storeModel->load($postData['store']['store_id']);
69101
}
102+
$originalCode = $storeModel->getCode();
103+
$newCode = $postData['store']['code'] ?? null;
70104
$storeModel->setData($postData['store']);
71105
if ($postData['store']['store_id'] == '') {
72106
$storeModel->setId(null);
@@ -84,7 +118,9 @@ private function processStoreSave($postData)
84118
}
85119
$storeModel->save();
86120
$this->messageManager->addSuccessMessage(__('You saved the store view.'));
87-
121+
if ($originalCode !== $newCode) {
122+
$this->cacheTypeList->cleanType('config');
123+
}
88124
return $postData;
89125
}
90126

@@ -120,7 +156,10 @@ private function processGroupSave($postData)
120156
}
121157

122158
/**
159+
* Saving edited store information
160+
*
123161
* @return \Magento\Backend\Model\View\Result\Redirect
162+
*
124163
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
125164
*/
126165
public function execute()
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
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="AdminDisableViewProductReportActionGroup">
12+
<annotations>
13+
<description>Admin disables most view products report in configuration</description>
14+
</annotations>
15+
<magentoCLI command="config:set {{AdminDisableReportConfigData.path}} {{AdminDisableReportConfigData.value}}" stepKey="setReportAsDisable"/>
16+
</actionGroup>
17+
</actionGroups>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
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="AdminEnableViewProductReportActionGroup">
12+
<annotations>
13+
<description>Admin enables most view products report in configuration</description>
14+
</annotations>
15+
<magentoCLI command="config:set {{AdminEnableReportConfigData.path}} {{AdminEnableReportConfigData.value}}" stepKey="setReportAsEnable"/>
16+
</actionGroup>
17+
</actionGroups>

app/code/Magento/Backend/Test/Mftf/Data/AdminMenuData.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
<data key="pageTitle">Dashboard</data>
2323
<data key="title">Dashboard</data>
2424
<data key="dataUiId">magento-backend-dashboard</data>
25+
<data key="message">Chart is disabled</data>
2526
</entity>
2627
<entity name="AdminMenuStores">
2728
<data key="pageTitle">Stores</data>

app/code/Magento/Backend/Test/Mftf/Data/AdminWebConfigData.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,12 @@
1616
<data key="path">web/seo/use_rewrites</data>
1717
<data key="value">0</data>
1818
</entity>
19+
<entity name="AdminEnableReportConfigData">
20+
<data key="path">reports/options/enabled</data>
21+
<data key="value">1</data>
22+
</entity>
23+
<entity name="AdminDisableReportConfigData">
24+
<data key="path">reports/options/enabled</data>
25+
<data key="value">0</data>
26+
</entity>
1927
</entities>

app/code/Magento/Backend/Test/Mftf/Section/AdminDashboardSection.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,14 @@
1919
<element name="dashboardTotals" type="text" selector="//*[@class='dashboard-totals-label' and contains(text(), '{{columnName}}')]/../*[@class='dashboard-totals-value']" parameterized="true"/>
2020
<element name="productInBestsellers" type="text" selector="#productsOrderedGrid_table td.col-product.col-name"/>
2121
<element name="dashboardButtonReloadData" type="button" selector=".action-primary[title='Reload Data'][type='submit']"/>
22+
<element name="productTab" type="button" selector="//*[@class='data-grid-th no-link col-name']" timeout="30"/>
23+
<element name="priceTab" type="button" selector="//*[@class='data-grid-th no-link col-price']" timeout="30"/>
24+
<element name="viewsTab" type="button" selector="//*[@class='data-grid-th col-views no-link col-views']" timeout="30"/>
25+
<element name="productName" type="text" selector="//td[contains(text(), '{{columnName}}')]" parameterized="true"/>
26+
<element name="productPrice" type="input" selector="//td[contains(text(), '{{productName}}')]//ancestor::td/following-sibling::td[contains(@class,' col-price a-right ')]" parameterized="true"/>
27+
<element name="productViews" type="input" selector="//td[contains(text(), '{{productName}}')]//ancestor::td/following-sibling::td[contains(@class,' col-views col-views last')]" parameterized="true"/>
28+
<element name="mostViewProductsTab" type="button" selector="//*[contains(@class, 'ui-state-default ui-corner-top') and contains(@aria-labelledby, 'grid_tab_reviewed_products')]" timeout="30"/>
29+
<element name="dashboardChart" type="text" selector="//*[@class='dashboard-diagram-disabled' and contains(text(), '{{columnName}}')]" parameterized="true"/>
2230
</section>
2331
</sections>
32+

0 commit comments

Comments
 (0)