Skip to content

Commit 1027727

Browse files
authored
Changes from upstream release Magento 2.4.8-p1 (#147)
1 parent 20f4faf commit 1027727

File tree

60 files changed

+373
-2137
lines changed

Some content is hidden

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

60 files changed

+373
-2137
lines changed

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

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010
use Magento\Catalog\Model\CategoryFactory;
1111
use Magento\Framework\App\Helper\AbstractHelper;
1212
use Magento\Framework\App\Helper\Context;
13+
use Magento\Framework\App\ObjectManager;
1314
use Magento\Framework\Data\CollectionFactory;
1415
use Magento\Framework\Data\Tree\Node\Collection;
16+
use Magento\Framework\Escaper;
1517
use Magento\Framework\Exception\NoSuchEntityException;
1618
use Magento\Framework\ObjectManager\ResetAfterRequestInterface;
1719
use Magento\Store\Model\ScopeInterface;
@@ -63,24 +65,33 @@ class Category extends AbstractHelper implements ResetAfterRequestInterface
6365
*/
6466
protected $categoryRepository;
6567

68+
/**
69+
* @var Escaper|null
70+
*/
71+
private ?Escaper $escaper;
72+
6673
/**
6774
* @param Context $context
6875
* @param CategoryFactory $categoryFactory
6976
* @param StoreManagerInterface $storeManager
7077
* @param CollectionFactory $dataCollectionFactory
7178
* @param CategoryRepositoryInterface $categoryRepository
79+
* @param Escaper|null $escaper
7280
*/
7381
public function __construct(
7482
Context $context,
7583
CategoryFactory $categoryFactory,
7684
StoreManagerInterface $storeManager,
7785
CollectionFactory $dataCollectionFactory,
78-
CategoryRepositoryInterface $categoryRepository
86+
CategoryRepositoryInterface $categoryRepository,
87+
?Escaper $escaper = null
7988
) {
8089
$this->_categoryFactory = $categoryFactory;
8190
$this->_storeManager = $storeManager;
8291
$this->_dataCollectionFactory = $dataCollectionFactory;
8392
$this->categoryRepository = $categoryRepository;
93+
$this->escaper = $escaper ?: ObjectManager::getInstance()->get(Escaper::class);
94+
8495
parent::__construct($context);
8596
}
8697

@@ -204,6 +215,7 @@ public function getCanonicalUrl(string $categoryUrl): string
204215
if ($params && isset($params['p'])) {
205216
$categoryUrl = $categoryUrl . '?p=' . $params['p'];
206217
}
207-
return $categoryUrl;
218+
219+
return $this->escaper->escapeUrl($categoryUrl);
208220
}
209221
}

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateCustomDropDownOptionsActionGroup.xml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
/**
4-
* Copyright 2025 Adobe
5-
* All Rights Reserved.
6-
*/
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
6+
*/
77
-->
88

99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -19,7 +19,6 @@
1919
<argument name="firstOption" type="entity"/>
2020
<argument name="secondOption" type="entity"/>
2121
</arguments>
22-
2322
<waitForElementClickable stepKey="waitForAddOptions" selector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}"/>
2423
<click stepKey="clickAddOptions" selector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}"/>
2524
<waitForPageLoad stepKey="waitForAddProductPageLoad"/>

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductGridFilterSection.xml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
/**
4-
* Copyright 2024 Adobe
5-
* All rights reserved.
6-
* See COPYING.txt for license details.
7-
*/
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
6+
*/
87
-->
98

109
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

app/code/Magento/Catalog/Test/Mftf/Test/AdminValidateSimpleProductWithCustomOptionsDragNDropPerPageTest.xml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
/**
4-
* Copyright 2025 Adobe
5-
* All Rights Reserved.
6-
*/
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
6+
*/
77
-->
88

99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -18,11 +18,8 @@
1818
<testCaseId value="AC-6086"/>
1919
<useCaseId value="ACP2E-980"/>
2020
<group value="SimpleProduct"/>
21-
<group value="pr_exclude"/>
2221
</annotations>
23-
2422
<scrollTo selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" stepKey="scrollToCustomOptions"/>
25-
2623
<!-- Create two more custom options with 2 values -->
2724
<actionGroup ref="AdminCreateCustomDropDownOptionsActionGroup" stepKey="createSecondCustomOption">
2825
<argument name="customOptionName" value="{{ProductOptionDropDown.title}}2"/>

app/code/Magento/Catalog/Test/Unit/Helper/CategoryTest.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Magento\Framework\App\Helper\Context;
1515
use Magento\Framework\App\RequestInterface;
1616
use Magento\Framework\Data\CollectionFactory;
17+
use Magento\Framework\Escaper;
1718
use Magento\Store\Model\StoreManagerInterface;
1819
use PHPUnit\Framework\MockObject\MockObject;
1920
use PHPUnit\Framework\TestCase;
@@ -63,6 +64,11 @@ class CategoryTest extends TestCase
6364
*/
6465
private $requestMock;
6566

67+
/**
68+
* @var Escaper|MockObject
69+
*/
70+
private $escaper;
71+
6672
protected function setUp(): void
6773
{
6874
$this->mockContext();
@@ -78,12 +84,16 @@ protected function setUp(): void
7884
$this->categoryRepository = $this->getMockBuilder(CategoryRepositoryInterface::class)
7985
->disableOriginalConstructor()
8086
->getMock();
87+
$this->escaper = $this->getMockBuilder(Escaper::class)
88+
->disableOriginalConstructor()
89+
->getMock();
8190
$this->categoryHelper = new Category(
8291
$this->context,
8392
$this->categoryFactory,
8493
$this->storeManager,
8594
$this->collectionFactory,
86-
$this->categoryRepository
95+
$this->categoryRepository,
96+
$this->escaper
8797
);
8898
}
8999

@@ -101,6 +111,9 @@ public function testGetCanonicalUrl(mixed $params, string $categoryUrl, string $
101111
$this->requestMock->expects($this->any())
102112
->method('getParams')
103113
->willReturn($params);
114+
$this->escaper->expects($this->any())
115+
->method('escapeUrl')
116+
->willReturn($expectedCategoryUrl);
104117
$actualCategoryUrl = $this->categoryHelper->getCanonicalUrl($categoryUrl);
105118
$this->assertEquals($actualCategoryUrl, $expectedCategoryUrl);
106119
}

app/code/Magento/CatalogRule/Model/Config/CatalogRule.php

Lines changed: 0 additions & 46 deletions
This file was deleted.

app/code/Magento/CatalogRule/Model/ResourceModel/GetAllCatalogRules.php

Lines changed: 0 additions & 56 deletions
This file was deleted.

app/code/Magento/CatalogRule/Model/ResourceModel/GetAppliedCatalogRules.php

Lines changed: 0 additions & 62 deletions
This file was deleted.

app/code/Magento/CatalogRule/etc/adminhtml/system.xml

Lines changed: 0 additions & 26 deletions
This file was deleted.

app/code/Magento/CatalogRule/etc/config.xml

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)