Skip to content

Commit 4e47f9e

Browse files
committed
Merge remote-tracking branch 'origin/2.4-develop' into ACP2E-782-2.4-develop
2 parents a9e1100 + 0953fe7 commit 4e47f9e

File tree

45 files changed

+1345
-402
lines changed

Some content is hidden

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

45 files changed

+1345
-402
lines changed

app/code/Magento/AdminAdobeIms/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"registration.php"
3434
],
3535
"psr-4": {
36-
"Magento\\Backend\\": ""
36+
"Magento\\AdminAdobeIms\\": ""
3737
}
3838
}
3939
}

app/code/Magento/Analytics/Model/ExportDataHandler.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
use Magento\Framework\App\Filesystem\DirectoryList;
1010
use Magento\Framework\Archive;
11+
use Magento\Framework\Exception\FileSystemException;
1112
use Magento\Framework\Exception\LocalizedException;
1213
use Magento\Framework\Filesystem;
1314
use Magento\Framework\Filesystem\Directory\WriteInterface;
@@ -89,8 +90,7 @@ public function __construct(
8990
public function prepareExportData()
9091
{
9192
try {
92-
$tmpDirectory = $this->filesystem->getDirectoryWrite(DirectoryList::SYS_TMP);
93-
93+
$tmpDirectory = $this->filesystem->getDirectoryWrite(DirectoryList::TMP);
9494
$this->prepareDirectory($tmpDirectory, $this->getTmpFilesDirRelativePath());
9595
$this->reportWriter->write($tmpDirectory, $this->getTmpFilesDirRelativePath());
9696

@@ -106,8 +106,10 @@ public function prepareExportData()
106106
$this->cryptographer->encode($tmpDirectory->readFile($this->getArchiveRelativePath()))
107107
);
108108
} finally {
109-
$tmpDirectory->delete($this->getTmpFilesDirRelativePath());
110-
$tmpDirectory->delete($this->getArchiveRelativePath());
109+
if (isset($tmpDirectory)) {
110+
$tmpDirectory->delete($this->getTmpFilesDirRelativePath());
111+
$tmpDirectory->delete($this->getArchiveRelativePath());
112+
}
111113
}
112114

113115
return true;

app/code/Magento/Analytics/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Magento_Analytics module
22

3-
The Magento_Analytics module integrates your Magento instance with the [Magento Business Intelligence (MBI)](https://magento.com/products/business-intelligence) to use [Advanced Reporting](https://devdocs.magento.com/guides/v2.4/advanced-reporting/modules.html) functionality.
3+
The Magento_Analytics module integrates your Magento instance with the [Magento Business Intelligence (MBI)](https://business.adobe.com/products/magento/business-intelligence.html) to use [Advanced Reporting](https://devdocs.magento.com/guides/v2.4/advanced-reporting/modules.html) functionality.
44

55
The module implements the following functionality:
66

app/code/Magento/Analytics/Test/Unit/Model/ExportDataHandlerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use Magento\Framework\Archive;
1616
use Magento\Framework\Filesystem;
1717
use Magento\Framework\Filesystem\Directory\WriteInterface;
18-
use Magento\Framework\Filesystem\DirectoryList;
18+
use Magento\Framework\App\Filesystem\DirectoryList;
1919
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
2020
use PHPUnit\Framework\MockObject\MockObject;
2121
use PHPUnit\Framework\TestCase;
@@ -127,7 +127,7 @@ public function testPrepareExportData($isArchiveSourceDirectory)
127127
$this->filesystemMock
128128
->expects($this->once())
129129
->method('getDirectoryWrite')
130-
->with(DirectoryList::SYS_TMP)
130+
->with(DirectoryList::TMP)
131131
->willReturn($this->directoryMock);
132132
$this->directoryMock
133133
->expects($this->exactly(4))
@@ -228,7 +228,7 @@ public function testPrepareExportDataWithLocalizedException()
228228
$this->filesystemMock
229229
->expects($this->once())
230230
->method('getDirectoryWrite')
231-
->with(DirectoryList::SYS_TMP)
231+
->with(DirectoryList::TMP)
232232
->willReturn($this->directoryMock);
233233
$this->reportWriterMock
234234
->expects($this->once())

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,8 @@
1111
<section name="AdminSystemAccountSection">
1212
<element name="interfaceLocale" type="select" selector="#interface_locale"/>
1313
<element name="currentPassword" type="text" selector="#current_password"/>
14+
<element name="username" type="text" selector="#username"/>
15+
<element name="newPassword" type="text" selector="#password"/>
16+
<element name="passwordConfirmation" type="text" selector="#confirmation"/>
1417
</section>
1518
</sections>
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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="AdminPasswordResetSettingsTest">
12+
<annotations>
13+
<features value="Backend"/>
14+
<stories value="[SPM-2] Password Reset settings (for Admin)"/>
15+
<title value="[SPM-2] Password Reset settings (for Admin)"/>
16+
<description value="Password Reset settings for Admin"/>
17+
<severity value="MINOR"/>
18+
<testCaseId value="MC-27441"/>
19+
<group value="Admin_UI"/>
20+
</annotations>
21+
22+
<before>
23+
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>
24+
</before>
25+
26+
<after>
27+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
28+
</after>
29+
30+
<!-- Goto Configurable>Advance>Admin and expand security Tab -->
31+
<amOnPage url="{{AdminConfigAdvancedAdmin.url}}" stepKey="navigateToConfigurationPage"/>
32+
<waitForPageLoad stepKey="wait1"/>
33+
<conditionalClick stepKey="expandSecurityTab" selector="{{AdminSection.SecurityTab}}" dependentSelector="{{AdminSection.CheckIfTabExpand}}" visible="true"/>
34+
35+
<!-- Uncheck system value and enter the number for password reset limitation -->
36+
<actionGroup ref="AdminUncheckUseSystemValueActionGroup" stepKey="uncheckUseSystemValue">
37+
<argument name="rowId" value="row_admin_security_max_number_password_reset_requests"/>
38+
</actionGroup>
39+
<waitForPageLoad stepKey="waitForPageLoad"/>
40+
<fillField selector="{{AdminSection.passwordLimitation}}" userInput="1" stepKey="fillNumbersForPasswordLimitation"/>
41+
<waitForPageLoad stepKey="waitForPageLoad1"/>
42+
43+
<!-- check system value after entering the password reset limitation and save the configuration-->
44+
<actionGroup ref="AdminCheckUseSystemValueActionGroup" stepKey="checkUseSystemValue">
45+
<argument name="rowId" value="row_admin_security_max_number_password_reset_requests"/>
46+
</actionGroup>
47+
<click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/>
48+
<actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSaveCookieLifetimeSuccessMessage">
49+
<argument name="message" value="You saved the configuration."/>
50+
<argument name="messageType" value="success"/>
51+
</actionGroup>
52+
53+
<!--Collabase Security Tab and log out -->
54+
<click selector="{{AdminSection.SecurityTab}}" stepKey="minimiseSecurityTab"/>
55+
56+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
57+
58+
<!-- login with wrong password and verify the error message first time1-->
59+
<amOnPage url="{{AdminLoginPage.url}}" stepKey="navigateToAdmin"/>
60+
<fillField selector="{{AdminLoginFormSection.username}}" userInput="admin" stepKey="fillUsername"/>
61+
<fillField selector="{{AdminLoginFormSection.password}}" userInput="Admin@1234" stepKey="fillPassword"/>
62+
<click selector="{{AdminLoginFormSection.signIn}}" stepKey="clickLogin"/>
63+
<actionGroup ref="AssertMessageOnAdminLoginActionGroup" stepKey="verifyErrorMessage"/>
64+
65+
<!-- login with wrong password and verify the error message first time2-->
66+
<amOnPage url="{{AdminLoginPage.url}}" stepKey="navigateToAdmin1"/>
67+
<fillField selector="{{AdminLoginFormSection.username}}" userInput="admin" stepKey="fillUsername1"/>
68+
<fillField selector="{{AdminLoginFormSection.password}}" userInput="Admin@1" stepKey="fillPassword1"/>
69+
<click selector="{{AdminLoginFormSection.signIn}}" stepKey="clickLogin1"/>
70+
<actionGroup ref="AssertMessageOnAdminLoginActionGroup" stepKey="verifyErrorMessage1"/>
71+
72+
<!-- login with valid credentials-->
73+
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin1"/>
74+
75+
</test>
76+
</tests>

app/code/Magento/Backend/etc/menu.xsd

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
<xs:simpleType name="typeId">
8686
<xs:annotation>
8787
<xs:documentation>
88-
Item id attribute can has only [a-z0-9/_]. Minimal length 3 symbol. Case insensitive.
88+
Item id attribute can have only [a-z0-9/_]. Minimal length 3 characters. Case insensitive.
8989
</xs:documentation>
9090
</xs:annotation>
9191
<xs:restriction base="xs:string">
@@ -96,7 +96,7 @@
9696
<xs:simpleType name="typeAction">
9797
<xs:annotation>
9898
<xs:documentation>
99-
Item action attribute can has only [a-zA-Z0-9/_]. Minimal length 3 symbol
99+
Item action attribute can have only [a-zA-Z0-9/_]. Minimal length 3 characters.
100100
</xs:documentation>
101101
</xs:annotation>
102102
<xs:restriction base="xs:string">
@@ -107,7 +107,7 @@
107107
<xs:simpleType name="typeTitle">
108108
<xs:annotation>
109109
<xs:documentation>
110-
Item title attribute minimal length 3 symbol
110+
Item title attribute minimal length 3 characters.
111111
</xs:documentation>
112112
</xs:annotation>
113113
<xs:restriction base="xs:string">
@@ -119,7 +119,7 @@
119119
<xs:simpleType name="typeModule">
120120
<xs:annotation>
121121
<xs:documentation>
122-
Item module attribute can has only [a-z0-9_]. Minimal length 3 symbol. Case insensitive.
122+
Item module attribute can have only [a-z0-9_]. Minimal length 3 characters. Case insensitive.
123123
</xs:documentation>
124124
</xs:annotation>
125125
<xs:restriction base="xs:string">
@@ -130,7 +130,7 @@
130130
<xs:simpleType name="typeResource">
131131
<xs:annotation>
132132
<xs:documentation>
133-
Item resource attribute can has only [a-z0-9_]. Minimal length 3 symbol. Case insensitive.
133+
Item resource attribute can have only [a-z0-9_]. Minimal length 3 characters. Case insensitive.
134134
</xs:documentation>
135135
</xs:annotation>
136136
<xs:restriction base="xs:string">
@@ -141,7 +141,7 @@
141141
<xs:simpleType name="typeDependsConfig">
142142
<xs:annotation>
143143
<xs:documentation>
144-
Item resource attribute can has only [a-z0-9_]. Minimal length 3 symbol. Case insensitive.
144+
Item dependsOnConfig attribute can have only [a-z0-9_]. Minimal length 3 characters. Case insensitive.
145145
</xs:documentation>
146146
</xs:annotation>
147147
<xs:restriction base="xs:string">

app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
use Magento\Catalog\Api\Data\ProductInterface;
1212
use Magento\Catalog\Api\ProductCustomOptionRepositoryInterface as OptionRepository;
1313
use Magento\Catalog\Model\Product\Option;
14+
use Magento\Catalog\Model\ResourceModel\Product\Relation;
1415
use Magento\Framework\App\ObjectManager;
1516
use Magento\Framework\EntityManager\Operation\ExtensionInterface;
16-
use Magento\Catalog\Model\ResourceModel\Product\Relation;
1717
use Magento\Framework\Exception\CouldNotSaveException;
1818

1919
/**
@@ -26,12 +26,12 @@ class SaveHandler implements ExtensionInterface
2626
/**
2727
* @var string[]
2828
*/
29-
private $compositeProductTypes = ['grouped', 'configurable', 'bundle'];
29+
private array $compositeProductTypes = ['grouped', 'configurable', 'bundle'];
3030

3131
/**
3232
* @var OptionRepository
3333
*/
34-
protected $optionRepository;
34+
protected OptionRepository $optionRepository;
3535

3636
/**
3737
* @var Relation
@@ -44,7 +44,7 @@ class SaveHandler implements ExtensionInterface
4444
*/
4545
public function __construct(
4646
OptionRepository $optionRepository,
47-
?Relation $relation = null
47+
?Relation $relation = null
4848
) {
4949
$this->optionRepository = $optionRepository;
5050
$this->relation = $relation ?: ObjectManager::getInstance()->get(Relation::class);
@@ -57,6 +57,7 @@ public function __construct(
5757
* @param array $arguments
5858
* @return ProductInterface|object
5959
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
60+
* @throws CouldNotSaveException
6061
*/
6162
public function execute($entity, $arguments = [])
6263
{
@@ -122,12 +123,11 @@ private function processOptionsSaving(array $options, bool $hasChangedSku, Produ
122123
private function isProductHasRelations(ProductInterface $product): bool
123124
{
124125
$result = true;
125-
if (!in_array($product->getId(), $this->compositeProductTypes)
126+
if (!in_array($product->getTypeId(), $this->compositeProductTypes)
126127
&& $this->relation->getRelationsByChildren([$product->getId()])
127128
) {
128129
$result = false;
129130
}
130-
131131
return $result;
132132
}
133133
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@
2424
<element name="productsInCategory" type="input" selector="div[data-index='assign_products']" timeout="30"/>
2525
<element name="scheduleDesignUpdateTab" type="block" selector="div[data-index='schedule_design_update']" timeout="15"/>
2626
<element name="categoryNameRequiredField" type="text" selector="//label[@class='admin__field-error' and contains(text(),'This is a required field.')]" timeout="15"/>
27+
<element name="urlExistsErrorMessage" type="text" selector="//div[@class='message message-error error']//h4[contains(text(),'The value specified in the URL Key field would generate a URL that already exists.')]" timeout="30"/>
2728
</section>
2829
</sections>

0 commit comments

Comments
 (0)