Skip to content

Commit 9268f0a

Browse files
committed
Merge branch '2.4.5-develop' of github.com:magento-gl/magento2ce into AC-3590
2 parents 4f551a5 + 315a517 commit 9268f0a

File tree

12 files changed

+66
-12
lines changed

12 files changed

+66
-12
lines changed

app/code/Magento/AdminAdobeIms/Service/ImsConfig.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class ImsConfig extends Config
2929
public const XML_PATH_PROFILE_URL = 'adobe_ims/integration/profile_url';
3030
public const XML_PATH_NEW_ADMIN_EMAIL_TEMPLATE = 'adobe_ims/email/content_template';
3131
public const XML_PATH_VALIDATE_TOKEN_URL = 'adobe_ims/integration/validate_token_url';
32-
public const XML_PATH_LOGOUT_URL = 'adobe_ims/integration/logout_url';
32+
public const XML_PATH_ADMIN_LOGOUT_URL = 'adobe_ims/integration/admin_logout_url';
3333
public const XML_PATH_CERTIFICATE_PATH = 'adobe_ims/integration/certificate_path';
3434
public const XML_PATH_ADMIN_AUTH_URL_PATTERN = 'adobe_ims/integration/admin/auth_url_pattern';
3535
public const XML_PATH_ADMIN_REAUTH_URL_PATTERN = 'adobe_ims/integration/admin/reauth_url_pattern';
@@ -353,7 +353,7 @@ public function getBackendLogoutUrl(string $accessToken) : string
353353
return str_replace(
354354
['#{access_token}', '#{client_secret}', '#{client_id}'],
355355
[$accessToken, $this->getPrivateKey(), $this->getApiKey()],
356-
$this->scopeConfig->getValue(self::XML_PATH_LOGOUT_URL)
356+
$this->scopeConfig->getValue(self::XML_PATH_ADMIN_LOGOUT_URL)
357357
);
358358
}
359359

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<token_url>https://ims-na1.adobelogin.com/ims/token</token_url>
2828
<profile_url><![CDATA[https://ims-na1.adobelogin.com/ims/profile/v1?client_id=#{client_id}]]></profile_url>
2929
<organization_membership_url><![CDATA[https://graph.identity.adobe.com/#{org_id}@AdobeOrg/membership]]></organization_membership_url>
30-
<logout_url><![CDATA[https://ims-na1.adobelogin.com/ims/logout/v1?access_token=#{access_token}&amp;client_id=#{client_id}&amp;client_secret=#{client_secret}]]></logout_url>
30+
<admin_logout_url><![CDATA[https://ims-na1.adobelogin.com/ims/logout/v1?access_token=#{access_token}&client_id=#{client_id}&client_secret=#{client_secret}]]></admin_logout_url>
3131
<certificate_path><![CDATA[https://static.adobelogin.com/keys/prod/]]></certificate_path>
3232
<validate_token_url><![CDATA[https://ims-na1.adobelogin.com/ims/validate_token/v1?token=#{token}&client_id=#{client_id}&type=#{token_type}]]></validate_token_url>
3333
</integration>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ private function getLocale(): string
108108
*/
109109
public function getLogoutUrl(string $accessToken, string $redirectUrl = '') : string
110110
{
111+
// there is no success response with empty redirect url
112+
if ($redirectUrl === '') {
113+
$redirectUrl = 'self';
114+
}
111115
return str_replace(
112116
['#{access_token}', '#{redirect_uri}'],
113117
[$accessToken, $redirectUrl],

app/code/Magento/AdobeIms/Model/GetAccessToken.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ public function execute(int $adminUserId = null): ?string
5555
{
5656
try {
5757
$adminUserId = $adminUserId ?? (int) $this->userContext->getUserId();
58-
return $this->userProfileRepository->getByUserId($adminUserId)->getAccessToken();
58+
return $this->encryptor->decrypt(
59+
$this->userProfileRepository->getByUserId($adminUserId)->getAccessToken()
60+
);
5961
} catch (NoSuchEntityException $exception) {
6062
return null;
6163
}

app/code/Magento/AdobeIms/Test/Unit/Model/GetAccessTokenTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,13 @@ public function testExecute(?string $token): void
7272
->willReturn($userProfileMock);
7373
$userProfileMock->expects($this->once())->method('getAccessToken')->willReturn($token);
7474

75+
$decryptedToken = $token ?? '';
76+
77+
$this->encryptor->expects($this->once())
78+
->method('decrypt')
79+
->with($token)
80+
->willReturn($decryptedToken);
81+
7582
$this->assertEquals($token, $this->getAccessToken->execute());
7683
}
7784

app/code/Magento/Customer/Test/Mftf/Section/AdminDeleteUserSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="AdminDeleteUserSection">
12-
<element name="theUser" selector="//td[contains(text(), 'John')]" type="button"/>
12+
<element name="theUser" selector="//td[contains(text(), '{{userName}}')]" type="button" parameterized="true"/>
1313
<element name="password" selector="#user_current_password" type="input"/>
1414
<element name="delete" selector=".page-actions-buttons #delete" type="button"/>
1515
<element name="confirm" selector="//*[@class='action-primary action-accept']" type="button"/>

app/code/Magento/Quote/Model/Quote.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
namespace Magento\Quote\Model;
77

8+
use Magento\Catalog\Model\Product\Attribute\Source\Status as ProductStatus;
89
use Magento\Customer\Api\Data\CustomerInterface;
910
use Magento\Customer\Api\Data\GroupInterface;
1011
use Magento\Directory\Model\AllowedCountries;
@@ -874,7 +875,8 @@ public function beforeSave()
874875
* Loading quote data by customer
875876
*
876877
* @param \Magento\Customer\Model\Customer|int $customer
877-
* @deprecated 101.0.0
878+
* @deprecated 101.0.0 Deprecated to handle external usages of customer methods
879+
* @see https://jira.corp.magento.com/browse/MAGETWO-19935
878880
* @return $this
879881
*/
880882
public function loadByCustomer($customer)
@@ -1427,12 +1429,14 @@ public function getItemsCollection($useCache = true)
14271429
public function getAllItems()
14281430
{
14291431
$items = [];
1432+
/** @var \Magento\Quote\Model\Quote\Item $item */
14301433
foreach ($this->getItemsCollection() as $item) {
1431-
/** @var \Magento\Quote\Model\Quote\Item $item */
1432-
if (!$item->isDeleted()) {
1434+
$product = $item->getProduct();
1435+
if (!$item->isDeleted() && ($product && (int)$product->getStatus() !== ProductStatus::STATUS_DISABLED)) {
14331436
$items[] = $item;
14341437
}
14351438
}
1439+
14361440
return $items;
14371441
}
14381442

app/code/Magento/Quote/Test/Unit/Model/QuoteTest.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,6 +1034,9 @@ public function testAddProductItemPreparation(): void
10341034
$itemMock->expects($this->any())
10351035
->method('representProduct')
10361036
->willReturn(true);
1037+
$itemMock->expects($this->any())
1038+
->method('getProduct')
1039+
->willReturn($this->productMock);
10371040

10381041
$iterator = new \ArrayIterator([$itemMock]);
10391042
$collectionMock->expects($this->any())
@@ -1402,20 +1405,26 @@ public function testGetItemsCollection(): void
14021405
public function testGetAllItems(): void
14031406
{
14041407
$itemOneMock = $this->getMockBuilder(\Magento\Quote\Model\ResourceModel\Quote\Item::class)
1405-
->addMethods(['isDeleted'])
1408+
->addMethods(['isDeleted', 'getProduct'])
14061409
->disableOriginalConstructor()
14071410
->getMock();
14081411
$itemOneMock->expects($this->once())
14091412
->method('isDeleted')
14101413
->willReturn(false);
1414+
$itemOneMock->expects($this->once())
1415+
->method('getProduct')
1416+
->willReturn($this->productMock);
14111417

14121418
$itemTwoMock = $this->getMockBuilder(\Magento\Quote\Model\ResourceModel\Quote\Item::class)
1413-
->addMethods(['isDeleted'])
1419+
->addMethods(['isDeleted', 'getProduct'])
14141420
->disableOriginalConstructor()
14151421
->getMock();
14161422
$itemTwoMock->expects($this->once())
14171423
->method('isDeleted')
14181424
->willReturn(true);
1425+
$itemTwoMock->expects($this->once())
1426+
->method('getProduct')
1427+
->willReturn($this->productMock);
14191428

14201429
$items = [$itemOneMock, $itemTwoMock];
14211430
$itemResult = [$itemOneMock];

app/code/Magento/Reports/Test/Mftf/Test/AdminCanceledOrdersInOrderSalesReportTest.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
</annotations>
2222

2323
<before>
24+
<!--Enable flat rate shipping-->
25+
<magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/>
2426
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
2527

2628
<createData entity="_defaultCategory" stepKey="createCategory"/>
@@ -72,6 +74,8 @@
7274
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
7375
<deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/>
7476
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
77+
<!-- Disable shipping method for customer with default address -->
78+
<magentoCLI command="config:set {{DisableFlatRateConfigData.path}} {{DisableFlatRateConfigData.value}}" stepKey="disableFlatRate"/>
7579
</after>
7680

7781
<actionGroup ref="AdminGoToOrdersReportPageActionGroup" stepKey="goToOrdersReportPage1"/>

app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderForCustomerWithTwoAddressesTaxableAndNonTaxableTest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@
7474
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
7575
<!--Disable free shipping method -->
7676
<magentoCLI command="config:set {{DisableFreeShippingConfigData.path}} {{DisableFreeShippingConfigData.value}}" stepKey="disableFreeShipping"/>
77+
<!-- Disable shipping method for customer with default address -->
78+
<magentoCLI command="config:set {{DisableFlatRateConfigData.path}} {{DisableFlatRateConfigData.value}}" stepKey="disableFlatRate"/>
7779
</after>
7880
</test>
7981
</tests>

0 commit comments

Comments
 (0)