Skip to content

Commit 0661c98

Browse files
committed
Merge remote-tracking branch 'origin/2.4-develop' into ACPT-717
2 parents 2f100b3 + c4b343b commit 0661c98

File tree

218 files changed

+4588
-1073
lines changed

Some content is hidden

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

218 files changed

+4588
-1073
lines changed

app/bootstrap.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
</div>
2828
HTML;
2929
}
30+
http_response_code(503);
3031
exit(1);
3132
}
3233

app/code/Magento/Authorization/Model/Acl/AclRetriever.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
*/
2222
class AclRetriever
2323
{
24-
const PERMISSION_ANONYMOUS = 'anonymous';
25-
const PERMISSION_SELF = 'self';
24+
public const PERMISSION_ANONYMOUS = 'anonymous';
25+
public const PERMISSION_SELF = 'self';
2626

2727
/**
2828
* @var \Psr\Log\LoggerInterface
@@ -117,7 +117,7 @@ public function getAllowedResourcesByRole($roleId)
117117
/** @var \Magento\Authorization\Model\Rules $ruleItem */
118118
foreach ($rulesCollection->getItems() as $ruleItem) {
119119
$resourceId = $ruleItem->getResourceId();
120-
if ($acl->has($resourceId) && $acl->isAllowed($roleId, $resourceId)) {
120+
if ($acl->hasResource($resourceId) && $acl->isAllowed($roleId, $resourceId)) {
121121
$allowedResources[] = $resourceId;
122122
}
123123
}

app/code/Magento/Authorization/Model/Acl/Loader/Rule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ private function applyPermissionsAccordingToRules(Acl $acl): array
104104
$resource = $rule['resource_id'];
105105
$privileges = !empty($rule['privileges']) ? explode(',', $rule['privileges']) : null;
106106

107-
if ($acl->has($resource)) {
107+
if ($acl->hasResource($resource)) {
108108
$foundResources[$resource] = $resource;
109109
if ($rule['permission'] == 'allow') {
110110
if ($resource === $this->_rootResource->getId()) {

app/code/Magento/Authorization/Model/Acl/Role/Generic.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
*/
66
namespace Magento\Authorization\Model\Acl\Role;
77

8+
use Laminas\Permissions\Acl\Role\GenericRole;
9+
810
/**
911
* Generic acl role
1012
*/
11-
class Generic extends \Zend_Acl_Role
13+
class Generic extends GenericRole
1214
{
1315
}

app/code/Magento/Authorization/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The Magento_Authorization module enables management of access control list roles
44

55
## Installation details
66

7-
The Magento_AdminNotification module creates the following tables in the database:
7+
The Magento_Authorization module creates the following tables in the database using `db_schema.xml`:
88

99
- `authorization_role`
1010
- `authorization_rule`

app/code/Magento/Authorization/Test/Unit/Model/Acl/AclRetrieverTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,9 @@ protected function createAclRetriever()
165165
/**
166166
* @var Acl|MockObject $aclMock
167167
*/
168-
$aclMock = $this->createPartialMock(Acl::class, ['has', 'isAllowed']);
169-
$aclMock->expects($this->any())->method('has')->willReturn(true);
170-
$aclMock->expects($this->any())->method('isAllowed')->willReturn(true);
168+
$aclMock = $this->createPartialMock(Acl::class, ['hasResource', 'isAllowed']);
169+
$aclMock->method('hasResource')->willReturn(true);
170+
$aclMock->method('isAllowed')->willReturn(true);
171171

172172
/**
173173
* @var Builder|MockObject $aclBuilderMock

app/code/Magento/Authorization/Test/Unit/Model/Acl/Loader/RuleTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public function testPopulateAclFromCache(): void
114114
);
115115

116116
$aclMock = $this->createMock(Acl::class);
117-
$aclMock->method('has')->willReturn(true);
117+
$aclMock->method('hasResource')->willReturn(true);
118118
$aclMock
119119
->method('allow')
120120
->withConsecutive(

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
namespace Magento\Backend\Controller\Adminhtml\System\Design;
88

99
use Magento\Framework\App\Action\HttpPostActionInterface;
10+
use Magento\Framework\Filter\FilterInput;
1011

1112
/**
1213
* Save design action.
@@ -21,13 +22,13 @@ class Save extends \Magento\Backend\Controller\Adminhtml\System\Design implement
2122
*/
2223
protected function _filterPostData($data)
2324
{
24-
$inputFilter = new \Zend_Filter_Input(
25+
$inputFilter = new FilterInput(
2526
['date_from' => $this->dateFilter, 'date_to' => $this->dateFilter],
2627
[],
2728
$data
2829
);
29-
$data = $inputFilter->getUnescaped();
30-
return $data;
30+
31+
return $inputFilter->getUnescaped();
3132
}
3233

3334
/**

app/code/Magento/Backend/Model/Auth/Session.php

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
* @api
1919
* @method \Magento\User\Model\User|null getUser()
2020
* @method \Magento\Backend\Model\Auth\Session setUser(\Magento\User\Model\User $value)
21-
* @method \Magento\Framework\Acl|null getAcl()
22-
* @method \Magento\Backend\Model\Auth\Session setAcl(\Magento\Framework\Acl $value)
2321
* @method int getUpdatedAt()
2422
* @method \Magento\Backend\Model\Auth\Session setUpdatedAt(int $value)
2523
*
@@ -62,6 +60,11 @@ class Session extends \Magento\Framework\Session\SessionManager implements \Mage
6260
*/
6361
private $messageManager;
6462

63+
/**
64+
* @var \Magento\Framework\Acl|null
65+
*/
66+
private $acl = null;
67+
6568
/**
6669
* @param \Magento\Framework\App\Request\Http $request
6770
* @param \Magento\Framework\Session\SidResolverInterface $sidResolver
@@ -152,7 +155,7 @@ public function isAllowed($resource, $privilege = null)
152155
return $acl->isAllowed($user->getAclRole(), $resource, $privilege);
153156
} catch (\Exception $e) {
154157
try {
155-
if (!$acl->has($resource)) {
158+
if (!$acl->hasResource($resource)) {
156159
return $acl->isAllowed($user->getAclRole(), null, $privilege);
157160
}
158161
} catch (\Exception $e) {
@@ -284,4 +287,33 @@ public function isValidForPath($path)
284287
{
285288
return true;
286289
}
290+
291+
/**
292+
* Set Acl model
293+
*
294+
* @return \Magento\Framework\Acl
295+
*/
296+
public function getAcl()
297+
{
298+
return $this->acl;
299+
}
300+
301+
/**
302+
* Retrieve Acl
303+
*
304+
* @param \Magento\Framework\Acl $acl
305+
* @return void
306+
*/
307+
public function setAcl(\Magento\Framework\Acl $acl)
308+
{
309+
$this->acl = $acl;
310+
}
311+
312+
/**
313+
* @inheritdoc
314+
*/
315+
public function getData($key = '', $clear = false)
316+
{
317+
return $key === 'acl' ? $this->getAcl() : parent::getData($key, $clear);
318+
}
287319
}

app/code/Magento/Backend/Test/Unit/Model/Auth/SessionTest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ protected function setUp(): void
7979
['getCookie', 'setPublicCookie']
8080
);
8181
$this->storage = $this->getMockBuilder(Storage::class)
82-
->addMethods(['getUser', 'getAcl', 'setAcl'])
82+
->addMethods(['getUser'])
8383
->disableOriginalConstructor()
8484
->getMock();
8585
$this->sessionConfig = $this->createPartialMock(
@@ -133,8 +133,6 @@ public function testRefreshAcl($isUserPassedViaParams)
133133
$userMock->expects($this->any())->method('getReloadAclFlag')->willReturn(true);
134134
$userMock->expects($this->once())->method('setReloadAclFlag')->with('0')->willReturnSelf();
135135
$userMock->expects($this->once())->method('save');
136-
$this->storage->expects($this->once())->method('setAcl')->with($aclMock);
137-
$this->storage->expects($this->any())->method('getAcl')->willReturn($aclMock);
138136
if ($isUserPassedViaParams) {
139137
$this->session->refreshAcl($userMock);
140138
} else {
@@ -250,7 +248,7 @@ public function testIsAllowed($isUserDefined, $isAclDefined, $isAllowed, $expect
250248
$aclMock = $this->getMockBuilder(Acl::class)
251249
->disableOriginalConstructor()
252250
->getMock();
253-
$this->storage->expects($this->any())->method('getAcl')->willReturn($aclMock);
251+
$this->session->setAcl($aclMock);
254252
}
255253
if ($isUserDefined) {
256254
$userMock = $this->getMockBuilder(User::class)

app/code/Magento/Bundle/Test/Mftf/Test/AdvanceCatalogSearchBundleByDescriptionTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<severity value="MAJOR"/>
1818
<testCaseId value="MC-25427"/>
1919
<group value="bundle"/>
20-
<group value="SearchEngineElasticsearch"/>
20+
<group value="SearchEngine"/>
2121
<group value="pr_exclude"/>
2222
</annotations>
2323
<before>

app/code/Magento/Bundle/Test/Mftf/Test/AdvanceCatalogSearchBundleByPriceTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<severity value="MAJOR"/>
1818
<testCaseId value="MC-25435"/>
1919
<group value="bundle"/>
20-
<group value="SearchEngineElasticsearch"/>
20+
<group value="SearchEngine"/>
2121
</annotations>
2222
<before>
2323
<createData entity="ApiProductWithDescription" stepKey="simple1" before="simple2"/>

app/code/Magento/Bundle/Test/Mftf/Test/AdvanceCatalogSearchBundleByShortDescriptionTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<severity value="MAJOR"/>
1818
<testCaseId value="MC-25434"/>
1919
<group value="bundle"/>
20-
<group value="SearchEngineElasticsearch"/>
20+
<group value="SearchEngine"/>
2121
</annotations>
2222
<before>
2323
<createData entity="ApiProductWithDescription" stepKey="simple1" before="simple2"/>

app/code/Magento/Bundle/Test/Mftf/Test/AdvanceCatalogSearchBundleProductTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<severity value="MAJOR"/>
1818
<testCaseId value="MC-25342"/>
1919
<group value="bundle"/>
20-
<group value="SearchEngineElasticsearch"/>
20+
<group value="SearchEngine"/>
2121
</annotations>
2222
<before>
2323
<createData entity="ApiProductWithDescription" stepKey="simple1" before="simple2"/>

app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAdvanceCatalogSearchBundleBySkuWithHyphenTest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<severity value="MAJOR"/>
1818
<testCaseId value="MC-28812"/>
1919
<group value="Bundle"/>
20-
<group value="SearchEngineElasticsearch"/>
20+
<group value="SearchEngine"/>
2121
<group value="pr_exclude"/>
2222
</annotations>
2323
<before>
@@ -44,4 +44,4 @@
4444
<deleteData createDataKey="simple2" before="delete" stepKey="deleteSimple2"/>
4545
</after>
4646
</test>
47-
</tests>
47+
</tests>

app/code/Magento/Catalog/Controller/Adminhtml/Category.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
namespace Magento\Catalog\Controller\Adminhtml;
99

1010
use Magento\Framework\App\ObjectManager;
11+
use Magento\Framework\Filter\FilterInput;
1112
use Magento\Store\Model\Store;
1213
use Magento\Framework\Controller\ResultFactory;
1314

@@ -22,7 +23,7 @@ abstract class Category extends \Magento\Backend\App\Action
2223
*
2324
* @see _isAllowed()
2425
*/
25-
const ADMIN_RESOURCE = 'Magento_Catalog::categories';
26+
public const ADMIN_RESOURCE = 'Magento_Catalog::categories';
2627

2728
/**
2829
* @var \Magento\Framework\Stdlib\DateTime\Filter\Date
@@ -154,6 +155,7 @@ private function resolveStoreId() : int
154155
* @return \Magento\Framework\Controller\Result\Json
155156
*
156157
* @deprecated 101.0.0
158+
* @see we don't recommend this approach anymore
157159
*/
158160
protected function ajaxRequestResponse($category, $resultPage)
159161
{
@@ -213,7 +215,7 @@ protected function dateTimePreprocessing($category, $postData)
213215
}
214216
}
215217
}
216-
$inputFilter = new \Zend_Filter_Input($dateFieldFilters, [], $postData);
218+
$inputFilter = new FilterInput($dateFieldFilters, [], $postData);
217219
return $inputFilter->getUnescaped();
218220
}
219221
}

app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
use Magento\Framework\Locale\FormatInterface;
2626
use Magento\Framework\Stdlib\DateTime\Filter\Date;
2727
use Magento\Store\Model\StoreManagerInterface;
28-
use Zend_Filter_Input;
28+
use Magento\Framework\Filter\FilterInput;
2929

3030
/**
3131
* Product helper
@@ -60,6 +60,7 @@ class Helper
6060
/**
6161
* @var Date
6262
* @deprecated 101.0.0
63+
* @see we don't recommend this approach anymore
6364
*/
6465
protected $dateFilter;
6566

@@ -250,7 +251,7 @@ public function initializeFromData(Product $product, array $productData)
250251
}
251252
}
252253

253-
$inputFilter = new Zend_Filter_Input($dateFieldFilters, [], $productData);
254+
$inputFilter = new FilterInput($dateFieldFilters, [], $productData);
254255
$productData = $inputFilter->getUnescaped();
255256

256257
if (isset($productData['options'])) {
@@ -435,6 +436,7 @@ private function overwriteValue($optionId, $option, $overwriteOptions)
435436
*
436437
* @return LinkResolver
437438
* @deprecated 102.0.0
439+
* @see we don't recommend this approach anymore
438440
*/
439441
private function getLinkResolver()
440442
{

app/code/Magento/Catalog/Model/Product/Filter/DateTime.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77

88
namespace Magento\Catalog\Model\Product\Filter;
99

10+
use Laminas\Filter\FilterInterface;
1011
use Magento\Framework\Stdlib\DateTime as StdlibDateTime;
1112
use Magento\Framework\Stdlib\DateTime\Filter\DateTime as StdlibDateTimeFilter;
1213

1314
/**
1415
* Product datetime fields values filter
1516
*/
16-
class DateTime implements \Zend_Filter_Interface
17+
class DateTime implements FilterInterface
1718
{
1819
/**
1920
* @var StdlibDateTimeFilter

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<testCaseId value="MC-25333"/>
1818
<group value="catalog"/>
1919
<group value="Product Attributes"/>
20-
<group value="SearchEngineElasticsearch"/>
20+
<group value="SearchEngine"/>
2121
</annotations>
2222
<before>
2323
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<testCaseId value="MC-28538"/>
1818
<group value="Catalog"/>
1919
<group value="Product Attributes"/>
20-
<group value="SearchEngineElasticsearch"/>
20+
<group value="SearchEngine"/>
2121
</annotations>
2222
<before>
2323
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<description value="User browses catalog, searches for product, adds product to cart, adds product to wishlist, compares products, uses coupon code and checks out."/>
1717
<severity value="CRITICAL"/>
1818
<testCaseId value="MAGETWO-87435"/>
19-
<group value="SearchEngineElasticsearch"/>
19+
<group value="SearchEngine"/>
2020
<group value="pr_exclude"/>
2121
</annotations>
2222
<before>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<testCaseId value="MC-30209"/>
1717
<severity value="CRITICAL"/>
1818
<group value="Catalog"/>
19-
<group value="SearchEngineElasticsearch"/>
19+
<group value="SearchEngine"/>
2020
<group value="pr_exclude"/>
2121
</annotations>
2222

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<severity value="MAJOR"/>
1818
<testCaseId value="MC-28813"/>
1919
<group value="Catalog"/>
20-
<group value="SearchEngineElasticsearch"/>
20+
<group value="SearchEngine"/>
2121
<group value="pr_exclude"/>
2222
</annotations>
2323
<before>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<severity value="MAJOR"/>
1818
<testCaseId value="MC-28816"/>
1919
<group value="catalog"/>
20-
<group value="SearchEngineElasticsearch"/>
20+
<group value="SearchEngine"/>
2121
<group value="pr_exclude"/>
2222
</annotations>
2323
<before>

app/code/Magento/Catalog/view/adminhtml/web/js/components/dynamic-rows-import-custom-options.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ define([
4040
_.each(item.options, function (option) {
4141
currentOption = utils.copy(option);
4242

43-
if (currentOption.hasOwnProperty('sort_order')) {
44-
delete currentOption['sort_order'];
45-
}
46-
4743
if (currentOption.hasOwnProperty('option_id')) {
4844
delete currentOption['option_id'];
4945
}

0 commit comments

Comments
 (0)