Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 807ee7d

Browse files
authored
Merge pull request #3540 from magento-epam/EPAM-PR-27
Fixed issues: MAGETWO-95812 Required RMA Attributes are not validated while Customer submits a return MAGETWO-96420 [2.3.x] [Magento Cloud] Customer receives newsletter unsubscription email after registering for new account MAGETWO-96434 [2.3.x] Autoscroll is missed on JS error on Storefront PDP [mobile] MAGETWO-96408 [2.3.x] [Magento Cloud] Error when saving Bundle product with a Scheduled Update
2 parents 858421f + a9dcd5d commit 807ee7d

12 files changed

+196
-6
lines changed

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

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ public function __construct(
5858
}
5959

6060
/**
61+
* Perform action on Bundle product relation/extension attribute
62+
*
6163
* @param object $entity
6264
* @param array $arguments
6365
*
@@ -83,7 +85,7 @@ public function execute($entity, $arguments = [])
8385
: [];
8486

8587
if (!$entity->getCopyFromView()) {
86-
$this->processRemovedOptions($entity->getSku(), $existingOptionsIds, $optionIds);
88+
$this->processRemovedOptions($entity, $existingOptionsIds, $optionIds);
8789
$newOptionsIds = array_diff($optionIds, $existingOptionsIds);
8890
$this->saveOptions($entity, $bundleProductOptions, $newOptionsIds);
8991
} else {
@@ -96,6 +98,8 @@ public function execute($entity, $arguments = [])
9698
}
9799

98100
/**
101+
* Remove option product links
102+
*
99103
* @param string $entitySku
100104
* @param \Magento\Bundle\Api\Data\OptionInterface $option
101105
* @return void
@@ -154,16 +158,19 @@ private function getOptionIds(array $options): array
154158
/**
155159
* Removes old options that no longer exists.
156160
*
157-
* @param string $entitySku
161+
* @param ProductInterface $entity
158162
* @param array $existingOptionsIds
159163
* @param array $optionIds
160164
* @return void
161165
*/
162-
private function processRemovedOptions(string $entitySku, array $existingOptionsIds, array $optionIds): void
166+
private function processRemovedOptions(ProductInterface $entity, array $existingOptionsIds, array $optionIds): void
163167
{
168+
$metadata = $this->metadataPool->getMetadata(ProductInterface::class);
169+
$parentId = $entity->getData($metadata->getLinkField());
164170
foreach (array_diff($existingOptionsIds, $optionIds) as $optionId) {
165-
$option = $this->optionRepository->get($entitySku, $optionId);
166-
$this->removeOptionLinks($entitySku, $option);
171+
$option = $this->optionRepository->get($entity->getSku(), $optionId);
172+
$option->setParentId($parentId);
173+
$this->removeOptionLinks($entity->getSku(), $option);
167174
$this->optionRepository->delete($option);
168175
}
169176
}

app/code/Magento/Newsletter/Model/Subscriber.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,12 @@ protected function _updateCustomerSubscription($customerId, $subscribe)
591591
if (AccountManagementInterface::ACCOUNT_CONFIRMATION_REQUIRED
592592
== $this->customerAccountManagement->getConfirmationStatus($customerId)
593593
) {
594-
$status = self::STATUS_UNCONFIRMED;
594+
if ($this->getId() && $this->getStatus() == self::STATUS_SUBSCRIBED) {
595+
// if a customer was already subscribed then keep the subscribed
596+
$status = self::STATUS_SUBSCRIBED;
597+
} else {
598+
$status = self::STATUS_UNCONFIRMED;
599+
}
595600
} elseif ($isConfirmNeed) {
596601
if ($this->getStatus() != self::STATUS_SUBSCRIBED) {
597602
$status = self::STATUS_NOT_ACTIVE;
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+
<!--Fill order information fields and click continue-->
12+
<actionGroup name="StorefrontFillOrderInformationActionGroup">
13+
<arguments>
14+
<argument name="orderId" type="string"/>
15+
<argument name="orderLastName"/>
16+
<argument name="orderEmail"/>
17+
</arguments>
18+
<amOnPage url="{{StorefrontOrdersAndReturnsPage.url}}" stepKey="navigateToOrderAndReturnPage"/>
19+
<waitForPageLoad stepKey="waitForPageLoad"/>
20+
<fillField selector="{{StorefrontOrderAndReturnInformationSection.orderId}}" userInput="{{orderId}}" stepKey="fillOrderId"/>
21+
<fillField selector="{{StorefrontOrderAndReturnInformationSection.bilingLastName}}" userInput="{{orderLastName}}" stepKey="fillBillingLastName"/>
22+
<fillField selector="{{StorefrontOrderAndReturnInformationSection.email}}" userInput="{{orderEmail}}" stepKey="fillEmail"/>
23+
<click selector="{{StorefrontOrderAndReturnInformationSection.continueButton}}" stepKey="clickContinue"/>
24+
<waitForPageLoad stepKey="waitForOrderInformationPageLoad"/>
25+
<seeInCurrentUrl url="{{StorefrontOrderInformationPage.url}}" stepKey="seeOrderInformationUrl"/>
26+
</actionGroup>
27+
28+
<!--Enter quantity to return and submit-->
29+
<actionGroup name="StorefrontFillQuantityToReturnActionGroup">
30+
<click selector="{{StorefrontOrderInformationMainSection.return}}" stepKey="gotToCreateNewReturnPage"/>
31+
<waitForPageLoad stepKey="waitForReturnPageLoad"/>
32+
<fillField selector="{{StorefrontCreateNewReturnMainSection.quantityToReturn}}" userInput="1" stepKey="fillQuantityToReturn"/>
33+
<click selector="{{StorefrontCreateNewReturnMainSection.submit}}" stepKey="clickSubmit"/>
34+
<waitForPageLoad stepKey="waitForPageLoad"/>
35+
</actionGroup>
36+
</actionGroups>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
10+
<entity name="EnableRMA" type="sales_rma_config">
11+
<requiredEntity type="enabled">EnableRMAStorefront</requiredEntity>
12+
</entity>
13+
<entity name="EnableRMAStorefront" type="enabled">
14+
<data key="value">1</data>
15+
</entity>
16+
17+
<entity name="DisableRMA" type="sales_rma_config">
18+
<requiredEntity type="enabled">DisableRMAStorefront</requiredEntity>
19+
</entity>
20+
<entity name="DisableRMAStorefront" type="enabled">
21+
<data key="value">0</data>
22+
</entity>
23+
</entities>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd">
9+
<operation name="SalesRMAConfig" dataType="sales_rma_config" type="create" auth="adminFormKey" url="/admin/system_config/save/section/sales/" method="POST">
10+
<object key="groups" dataType="sales_rma_config">
11+
<object key="rma" dataType="sales_rma_config">
12+
<object key="fields" dataType="sales_rma_config">
13+
<object key="enabled" dataType="enabled">
14+
<field key="value">string</field>
15+
</object>
16+
</object>
17+
</object>
18+
</object>
19+
</operation>
20+
</operations>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11+
<page name="StorefrontCreateNewReturnPage" url="rma/guest/create/order_id/" area="guest" module="Magento_Sales">
12+
<section name="StorefrontCreateNewReturnMainSection"/>
13+
</page>
14+
</pages>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11+
<page name="StorefrontOrderInformationPage" url="sales/guest/view" area="guest" module="Magento_Sales">
12+
<section name="StorefrontOrderInformationMainSection"/>
13+
</page>
14+
</pages>
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11+
<page name="StorefrontOrdersAndReturnsPage" url="sales/guest/form" area="guest" module="Magento_Sales">
12+
<section name="OrderAndReturnsMainSection"/>
13+
<section name="OrderInformationSection"/>
14+
</page>
15+
</pages>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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="StorefrontCreateNewReturnMainSection">
12+
<element name="quantityToReturn" type="input" selector="#items:qty_requested0"/>
13+
<element name="submit" type="submit" selector="//span[contains(text(), 'Submit')]"/>
14+
<element name="resolutionError" type="text" selector="//*[@id='items:resolution0']/following-sibling::div[contains(text(),'Please select an option')]"/>
15+
<element name="conditionError" type="text" selector="//*[@id='items:condition0']/following-sibling::div[contains(text(),'Please select an option')]"/>
16+
<element name="reasonError" type="text" selector="//*[@id='items:reason0']/following-sibling::div[contains(text(),'Please select an option')]"/>
17+
</section>
18+
</sections>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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="StorefrontOrderAndReturnInformationSection">
12+
<element name="orderId" type="input" selector="#oar-order-id"/>
13+
<element name="bilingLastName" type="input" selector="#oar-billing-lastname"/>
14+
<element name="findOrderBy" type="select" selector="#quick-search-type-id"/>
15+
<element name="email" type="input" selector="#oar_email"/>
16+
<element name="bilingZipCode" type="input" selector="//input[@id='oar_zip']"/>
17+
<element name="continueButton" type="submit" selector="//button[@title='Continue']"/>
18+
<element name="ordersAndReturnsTitle" type="span" selector="//span[@id='page-title-wrapper']"/>
19+
</section>
20+
</sections>
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="StorefrontOrderInformationMainSection">
12+
<element name="orderTitle" type="span" selector="#page-title-wrapper"/>
13+
<element name="return" type="span" selector="//span[contains(text(), 'Return')]"/>
14+
</section>
15+
</sections>

lib/web/mage/validation.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1950,6 +1950,9 @@
19501950
}
19511951

19521952
if (firstActive.length) {
1953+
$('html, body').animate({
1954+
scrollTop: firstActive.offset().top
1955+
});
19531956
firstActive.focus();
19541957
}
19551958
}

0 commit comments

Comments
 (0)