Skip to content

Commit a8ffe0b

Browse files
authored
Merge branch '2.4-develop' into fix-26976
2 parents 50bf2f5 + 1dc62a7 commit a8ffe0b

File tree

241 files changed

+2659
-879
lines changed

Some content is hidden

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

241 files changed

+2659
-879
lines changed

app/code/Magento/AdminAnalytics/etc/csp_whitelist.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,24 @@
1313
<value id="adobedtm" type="host">assets.adobedtm.com</value>
1414
</values>
1515
</policy>
16+
<policy id="img-src">
17+
<values>
18+
<value id="adobedtm" type="host">assets.adobedtm.com</value>
19+
<value id="omtrdc" type="host">amcglobal.sc.omtrdc.net</value>
20+
<value id="dpmdemdex" type="host">dpm.demdex.net</value>
21+
<value id="everesttech" type="host">cm.everesttech.net</value>
22+
</values>
23+
</policy>
24+
<policy id="connect-src">
25+
<values>
26+
<value id="dpmdemdex" type="host">dpm.demdex.net</value>
27+
<value id="omtrdc" type="host">amcglobal.sc.omtrdc.net</value>
28+
</values>
29+
</policy>
30+
<policy id="frame-src">
31+
<values>
32+
<value id="amcdemdex" type="host">fast.amc.demdex.net</value>
33+
</values>
34+
</policy>
1635
</policies>
1736
</csp_whitelist>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminNotificationToolbarSection">
12+
<element name="notification" type="block" selector=".notifications-wrapper.admin__action-dropdown-wrap"/>
13+
<element name="notificationCounter" type="block" selector=".notifications-action.admin__action-dropdown .notifications-counter"/>
14+
</section>
15+
</sections>
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
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="AdminSystemNotificationToolbarBlockAclTest">
12+
<annotations>
13+
<features value="AdminNotification"/>
14+
<stories value="Acl notification toolbar"/>
15+
<title value="Admin system notification toolbar block acl test"/>
16+
<description value="Admin should not see system notification toolbar block if acl not restricted"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-36011"/>
19+
<group value="menu"/>
20+
</annotations>
21+
<before>
22+
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>
23+
24+
<actionGroup ref="AdminFillUserRoleRequiredDataActionGroup" stepKey="fillUserRoleRequiredData">
25+
<argument name="User" value="adminRole"/>
26+
<argument name="restrictedRole" value="Stores"/>
27+
</actionGroup>
28+
<actionGroup ref="AdminUserClickRoleResourceTabActionGroup" stepKey="goToRoleResourcesTab" />
29+
<actionGroup ref="AdminAddRestrictedRoleActionGroup" stepKey="addRestrictedRoleStores">
30+
<argument name="User" value="adminRole"/>
31+
<argument name="restrictedRole" value="Products"/>
32+
</actionGroup>
33+
<actionGroup ref="AdminUserSaveRoleActionGroup" stepKey="saveUserRole" />
34+
35+
<actionGroup ref="AdminCreateUserActionGroup" stepKey="createAdminUser">
36+
<argument name="role" value="adminRole"/>
37+
<argument name="User" value="admin2"/>
38+
</actionGroup>
39+
40+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/>
41+
</before>
42+
<after>
43+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAsSaleRoleUser"/>
44+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
45+
<!--Delete created data-->
46+
<actionGroup ref="AdminUserOpenAdminRolesPageActionGroup" stepKey="navigateToUserRoleGrid"/>
47+
<actionGroup ref="AdminDeleteRoleActionGroup" stepKey="deleteUserRole">
48+
<argument name="role" value="adminRole"/>
49+
</actionGroup>
50+
<actionGroup ref="AdminOpenAdminUsersPageActionGroup" stepKey="goToAllUsersPage"/>
51+
<actionGroup ref="AdminDeleteNewUserActionGroup" stepKey="deleteUser">
52+
<argument name="userName" value="{{admin2.username}}"/>
53+
</actionGroup>
54+
</after>
55+
56+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsNewUser">
57+
<argument name="username" value="{{admin2.username}}"/>
58+
<argument name="password" value="{{admin2.password}}"/>
59+
</actionGroup>
60+
61+
<waitForPageLoad stepKey="waitBeforePageLoad"/>
62+
<dontSeeElement selector="{{AdminNotificationToolbarSection.notification}}" stepKey="doNotSeeNotificationBellIcon"/>
63+
</test>
64+
</tests>

app/code/Magento/AdminNotification/view/adminhtml/layout/default.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@
2020
template="Magento_AdminNotification::notification/window.phtml"/>
2121
</referenceContainer>
2222
<referenceContainer name="header">
23-
<block class="Magento\AdminNotification\Block\ToolbarEntry" name="notification.messages" before="user" template="Magento_AdminNotification::toolbar_entry.phtml"/>
23+
<block class="Magento\AdminNotification\Block\ToolbarEntry"
24+
name="notification.messages"
25+
before="user"
26+
aclResource="Magento_AdminNotification::show_toolbar"
27+
template="Magento_AdminNotification::toolbar_entry.phtml"/>
2428
</referenceContainer>
2529
</body>
2630
</page>

app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface;
1111

1212
/**
13-
* Class AdvancedPricing
13+
* Import advanced pricing class
1414
*
1515
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
1616
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -19,43 +19,27 @@
1919
class AdvancedPricing extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity
2020
{
2121
const VALUE_ALL_GROUPS = 'ALL GROUPS';
22-
2322
const VALUE_ALL_WEBSITES = 'All Websites';
24-
2523
const COL_SKU = 'sku';
26-
2724
const COL_TIER_PRICE_WEBSITE = 'tier_price_website';
28-
2925
const COL_TIER_PRICE_CUSTOMER_GROUP = 'tier_price_customer_group';
30-
3126
const COL_TIER_PRICE_QTY = 'tier_price_qty';
32-
3327
const COL_TIER_PRICE = 'tier_price';
34-
3528
const COL_TIER_PRICE_PERCENTAGE_VALUE = 'percentage_value';
36-
3729
const COL_TIER_PRICE_TYPE = 'tier_price_value_type';
38-
3930
const TIER_PRICE_TYPE_FIXED = 'Fixed';
40-
4131
const TIER_PRICE_TYPE_PERCENT = 'Discount';
42-
4332
const TABLE_TIER_PRICE = 'catalog_product_entity_tier_price';
44-
4533
const DEFAULT_ALL_GROUPS_GROUPED_PRICE_VALUE = '0';
46-
4734
const ENTITY_TYPE_CODE = 'advanced_pricing';
48-
4935
const VALIDATOR_MAIN = 'validator';
50-
5136
const VALIDATOR_WEBSITE = 'validator_website';
5237

5338
/**
5439
* @deprecated
5540
* @see VALIDATOR_TIER_PRICE
5641
*/
5742
private const VALIDATOR_TEAR_PRICE = 'validator_tier_price';
58-
5943
private const VALIDATOR_TIER_PRICE = 'validator_tier_price';
6044

6145
/**
@@ -176,10 +160,8 @@ class AdvancedPricing extends \Magento\ImportExport\Model\Import\Entity\Abstract
176160
* @param \Magento\Framework\Json\Helper\Data $jsonHelper
177161
* @param \Magento\ImportExport\Helper\Data $importExportData
178162
* @param \Magento\ImportExport\Model\ResourceModel\Import\Data $importData
179-
* @param \Magento\Eav\Model\Config $config
180163
* @param \Magento\Framework\App\ResourceConnection $resource
181164
* @param \Magento\ImportExport\Model\ResourceModel\Helper $resourceHelper
182-
* @param \Magento\Framework\Stdlib\StringUtils $string
183165
* @param ProcessingErrorAggregatorInterface $errorAggregator
184166
* @param \Magento\Framework\Stdlib\DateTime\DateTime $dateTime
185167
* @param \Magento\CatalogImportExport\Model\Import\Proxy\Product\ResourceModelFactory $resourceFactory
@@ -197,10 +179,8 @@ public function __construct(
197179
\Magento\Framework\Json\Helper\Data $jsonHelper,
198180
\Magento\ImportExport\Helper\Data $importExportData,
199181
\Magento\ImportExport\Model\ResourceModel\Import\Data $importData,
200-
\Magento\Eav\Model\Config $config,
201182
\Magento\Framework\App\ResourceConnection $resource,
202183
\Magento\ImportExport\Model\ResourceModel\Helper $resourceHelper,
203-
\Magento\Framework\Stdlib\StringUtils $string,
204184
ProcessingErrorAggregatorInterface $errorAggregator,
205185
\Magento\Framework\Stdlib\DateTime\DateTime $dateTime,
206186
\Magento\CatalogImportExport\Model\Import\Proxy\Product\ResourceModelFactory $resourceFactory,

app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricingTest.php

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use Magento\CatalogImportExport\Model\Import\Product\RowValidatorInterface as RowValidatorInterface;
1717
use Magento\CatalogImportExport\Model\Import\Product\StoreResolver;
1818
use Magento\CatalogImportExport\Model\Import\Proxy\Product\ResourceModelFactory as ResourceFactory;
19-
use Magento\Eav\Model\Config;
2019
use Magento\Eav\Model\Entity\Type;
2120
use Magento\Framework\App\ResourceConnection;
2221
use Magento\Framework\DB\Adapter\AdapterInterface;
@@ -26,7 +25,6 @@
2625
use Magento\Framework\Json\Helper\Data;
2726
use Magento\Framework\Stdlib\DateTime\DateTime;
2827
use Magento\Framework\Stdlib\DateTime\TimezoneInterface;
29-
use Magento\Framework\Stdlib\StringUtils;
3028
use Magento\ImportExport\Model\Import;
3129
use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface;
3230
use Magento\ImportExport\Model\ResourceModel\Helper;
@@ -99,11 +97,6 @@ class AdvancedPricingTest extends AbstractImportTestCase
9997
*/
10098
protected $dataSourceModel;
10199

102-
/**
103-
* @var Config
104-
*/
105-
protected $eavConfig;
106-
107100
/**
108101
* @var TimezoneInterface|MockObject
109102
*/
@@ -139,11 +132,6 @@ class AdvancedPricingTest extends AbstractImportTestCase
139132
*/
140133
protected $advancedPricing;
141134

142-
/**
143-
* @var StringUtils
144-
*/
145-
protected $stringObject;
146-
147135
/**
148136
* @var ProcessingErrorAggregatorInterface
149137
*/
@@ -165,10 +153,8 @@ protected function setUp(): void
165153
);
166154
$this->resource->method('getConnection')->willReturn($this->connection);
167155
$this->dataSourceModel = $this->createMock(\Magento\ImportExport\Model\ResourceModel\Import\Data::class);
168-
$this->eavConfig = $this->createMock(Config::class);
169156
$entityType = $this->createMock(Type::class);
170157
$entityType->method('getEntityTypeId')->willReturn('');
171-
$this->eavConfig->method('getEntityType')->willReturn($entityType);
172158
$this->resourceFactory = $this->getMockBuilder(
173159
\Magento\CatalogImportExport\Model\Import\Proxy\Product\ResourceModelFactory::class
174160
)
@@ -193,7 +179,6 @@ protected function setUp(): void
193179
$this->tierPriceValidator = $this->createMock(
194180
TierPrice::class
195181
);
196-
$this->stringObject = $this->createMock(StringUtils::class);
197182
$this->errorAggregator = $this->getErrorAggregatorObject();
198183
$this->dateTime = $this->getMockBuilder(DateTime::class)
199184
->disableOriginalConstructor()
@@ -1070,10 +1055,8 @@ private function getAdvancedPricingMock($methods = [])
10701055
$this->jsonHelper,
10711056
$this->importExportData,
10721057
$this->dataSourceModel,
1073-
$this->eavConfig,
10741058
$this->resource,
10751059
$this->resourceHelper,
1076-
$this->stringObject,
10771060
$this->errorAggregator,
10781061
$this->dateTime,
10791062
$this->resourceFactory,
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminOpenGeneralConfigurationPageActionGroup">
12+
<annotations>
13+
<description>Open general configuration page.</description>
14+
</annotations>
15+
16+
<amOnPage url="{{GeneralConfigurationPage.url}}" stepKey="openGeneralConfigurationPage"/>
17+
<waitForPageLoad stepKey="waitForPageLoad"/>
18+
</actionGroup>
19+
</actionGroups>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminOpenWebConfigurationPageActionGroup">
12+
<annotations>
13+
<description>Open web configuration page.</description>
14+
</annotations>
15+
16+
<amOnPage url="{{WebConfigurationPage.url}}" stepKey="openWebConfigurationPage"/>
17+
<waitForPageLoad stepKey="waitPageToLoad"/>
18+
</actionGroup>
19+
</actionGroups>

app/code/Magento/Bundle/Model/Product/LinksList.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ public function __construct(
3939
}
4040

4141
/**
42+
* Bundle Product Items Data
43+
*
4244
* @param \Magento\Catalog\Api\Data\ProductInterface $product
4345
* @param int $optionId
4446
* @return \Magento\Bundle\Api\Data\LinkInterface[]
@@ -50,8 +52,12 @@ public function getItems(\Magento\Catalog\Api\Data\ProductInterface $product, $o
5052
$productLinks = [];
5153
/** @var \Magento\Catalog\Model\Product $selection */
5254
foreach ($selectionCollection as $selection) {
55+
$bundledProductPrice = $selection->getSelectionPriceValue();
56+
if ($bundledProductPrice <= 0) {
57+
$bundledProductPrice = $selection->getPrice();
58+
}
5359
$selectionPriceType = $product->getPriceType() ? $selection->getSelectionPriceType() : null;
54-
$selectionPrice = $product->getPriceType() ? $selection->getSelectionPriceValue() : null;
60+
$selectionPrice = $bundledProductPrice ? $bundledProductPrice : null;
5561

5662
/** @var \Magento\Bundle\Api\Data\LinkInterface $productLink */
5763
$productLink = $this->linkFactory->create();

app/code/Magento/Bundle/Model/ResourceModel/Selection/Collection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ public function joinPrices($websiteId)
215215
public function setOptionIdsFilter($optionIds)
216216
{
217217
if (!empty($optionIds)) {
218-
$this->getSelect()->where('selection.option_id IN (?)', $optionIds);
218+
$this->getSelect()->where('selection.option_id IN (?)', $optionIds, \Zend_Db::INT_TYPE);
219219
}
220220
return $this;
221221
}
@@ -229,7 +229,7 @@ public function setOptionIdsFilter($optionIds)
229229
public function setSelectionIdsFilter($selectionIds)
230230
{
231231
if (!empty($selectionIds)) {
232-
$this->getSelect()->where('selection.selection_id IN (?)', $selectionIds);
232+
$this->getSelect()->where('selection.selection_id IN (?)', $selectionIds, \Zend_Db::INT_TYPE);
233233
}
234234
return $this;
235235
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@
7171

7272
<!--Click add to cart-->
7373
<moveMouseOver selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" stepKey="hoverProduct"/>
74-
<click selector="{{StorefrontCategoryMainSection.AddToCartBtn}}" stepKey="addProductToCart"/>
75-
<waitForPageLoad stepKey="waitForProductPage"/>
74+
<actionGroup ref="StorefrontClickAddToCartButtonActionGroup" stepKey="addProductToCart"/>
7675

7776
<!--Check for details page-->
7877
<seeInCurrentUrl url="{{BundleProduct.sku}}" stepKey="seeBundleProductDetailsPage"/>

app/code/Magento/Bundle/Test/Unit/Model/Product/LinksListTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function testLinksList()
9191
->method('getSelectionsCollection')
9292
->with([$optionId], $this->productMock)
9393
->willReturn([$this->selectionMock]);
94-
$this->productMock->expects($this->exactly(2))->method('getPriceType')->willReturn('price_type');
94+
$this->productMock->expects($this->once())->method('getPriceType')->willReturn('price_type');
9595
$this->selectionMock->expects($this->once())
9696
->method('getSelectionPriceType')
9797
->willReturn('selection_price_type');

app/code/Magento/BundleGraphQl/Model/Resolver/Links/Collection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ private function fetch() : array
108108
}
109109

110110
$linkCollection->getSelect()
111-
->where($field . ' IN (?)', $this->parentIds);
111+
->where($field . ' IN (?)', $this->parentIds, \Zend_Db::INT_TYPE);
112112

113113
/** @var Selection $link */
114114
foreach ($linkCollection as $link) {
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminOpenAdminThreeDSecurePageActionGroup">
12+
<annotations>
13+
<description>Open ThreeDSecure page.</description>
14+
</annotations>
15+
16+
<amOnPage url="{{AdminThreeDSecurePage.url}}" stepKey="openAdminThreeDSecurePage"/>
17+
<waitForPageLoad stepKey="waitThreeDSecurePageToLoad"/>
18+
</actionGroup>
19+
</actionGroups>

0 commit comments

Comments
 (0)