Skip to content

Commit 48400ae

Browse files
authored
Merge pull request #3207 from magento-qwerty/2.3-bugfixes-150918
[Qwerty] Bugfixes
2 parents 09cfa64 + 7729695 commit 48400ae

File tree

25 files changed

+632
-812
lines changed

25 files changed

+632
-812
lines changed

app/code/Magento/Backend/view/adminhtml/templates/system/search.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<% if (data.items.length) { %>
4343
<% _.each(data.items, function(value){ %>
4444
<li class="item"
45-
<%- data.optionData(value) %>
45+
<%= data.optionData(value) %>
4646
>
4747
<a href="<%- value.url %>" class="title"><%- value.name %></a>
4848
<span class="type"><%- value.type %></span>

app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/attribute_set.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<% } %>
1515
<ul data-mage-init='{"menu":[]}'>
1616
<% _.each(data.items, function(value) { %>
17-
<li <%- data.optionData(value) %>><a href="#"><%- value.label %></a></li>
17+
<li <%= data.optionData(value) %>><a href="#"><%- value.label %></a></li>
1818
<% }); %>
1919
</ul>
2020
<% if (!data.term && data.items.length && !data.allShown()) { %>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +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="StorefrontCustomerOrderSection">
12+
<element name="isMyOrdersSection" type="text" selector="//*[@class='page-title']//*[contains(text(), 'My Orders')]"/>
1213
<element name="productCustomOptions" type="text" selector="//strong[contains(@class, 'product-item-name') and normalize-space(.)='{{var1}}']/following-sibling::*[contains(@class, 'item-options')]/dt[normalize-space(.)='{{var2}}']/following-sibling::dd[normalize-space(.)='{{var3}}']" parameterized="true"/>
1314
<element name="productCustomOptionsFile" type="text" selector="//strong[contains(@class, 'product-item-name') and normalize-space(.)='{{var1}}']/following-sibling::*[contains(@class, 'item-options')]/dt[normalize-space(.)='{{var2}}']/following-sibling::dd[contains(.,'{{var3}}')]" parameterized="true"/>
1415
<element name="productCustomOptionsLink" type="text" selector="//strong[contains(@class, 'product-item-name') and normalize-space(.)='{{var1}}']/following-sibling::*[contains(@class, 'item-options')]/dt[normalize-space(.)='{{var2}}']/following-sibling::dd//a[text() = '{{var3}}']" parameterized="true"/>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
<element name="myOrdersTable" type="text" selector="#my-orders-table"/>
1414
<element name="subtotal" type="text" selector=".subtotal .amount"/>
1515
<element name="paymentMethod" type="text" selector=".payment-method dt"/>
16+
<element name="printOrderLink" type="text" selector="a.action.print" timeout="30"/>
1617
</section>
1718
</sections>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="CreateOrderToPrintPageActionGroup">
12+
<arguments>
13+
<argument name="Category"/>
14+
</arguments>
15+
<amOnPage url="{{StorefrontCategoryPage.url(Category.name)}}" stepKey="onCategoryPage"/>
16+
<waitForPageLoad stepKey="waitForPageLoad1"/>
17+
<moveMouseOver selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" stepKey="hoverProduct"/>
18+
<click selector="{{StorefrontCategoryMainSection.AddToCartBtn}}" stepKey="addToCart"/>
19+
<waitForElementVisible selector="{{StorefrontCategoryMainSection.SuccessMsg}}" time="30" stepKey="waitForProductAdded"/>
20+
<click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickCart"/>
21+
<click selector="{{StorefrontMinicartSection.goToCheckout}}" stepKey="goToCheckout"/>
22+
<waitForPageLoad stepKey="waitForPageLoad2"/>
23+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/>
24+
<click selector="{{CheckoutShippingMethodsSection.firstShippingMethod}}" stepKey="selectFirstShippingMethod"/>
25+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask2"/>
26+
<waitForElement selector="{{CheckoutShippingMethodsSection.next}}" time="30" stepKey="waitForNextButton"/>
27+
<click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickNext"/>
28+
<waitForElement selector="{{CheckoutPaymentSection.placeOrder}}" time="30" stepKey="waitForPlaceOrderButton"/>
29+
<click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/>
30+
<click selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="clickOrderLink"/>
31+
<click selector="{{StorefrontCustomerOrderViewSection.printOrderLink}}" stepKey="clickPrintOrderLink"/>
32+
</actionGroup>
33+
</actionGroups>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd">
11+
<page name="StorefrontCustomerSignOutPage" url="/customer/account/logout/" area="storefront" module="Magento_Customer"/>
12+
</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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd">
11+
<page name="StorefrontSalesOrderPrintPage" url="/sales/order/print/order_id/{{var1}}/" parameterized="true"
12+
area="storefront" module="Magento_Sales">
13+
<section name="SalesOrderPrintSection"/>
14+
</page>
15+
</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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
11+
<section name="SalesOrderPrintSection">
12+
<element name="isOrderPrintPage" type="block" selector=".preview-area"/>
13+
</section>
14+
</sections>
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
11+
<test name="StorefrontRedirectToOrderHistory">
12+
<annotations>
13+
<features value="Redirection Rules"/>
14+
<title value="Create Invoice"/>
15+
<description
16+
value="Check while order printing URL with an id of not relevant order redirects to order history"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MAGETWO-92854"/>
19+
<group value="sales"/>
20+
</annotations>
21+
<before>
22+
<createData entity="_defaultCategory" stepKey="createCategory"/>
23+
<createData entity="_defaultProduct" stepKey="createProduct">
24+
<requiredEntity createDataKey="createCategory"/>
25+
</createData>
26+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
27+
<createData entity="Simple_US_Customer" stepKey="createCustomer2"/>
28+
</before>
29+
<after>
30+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
31+
<deleteData createDataKey="createCustomer2" stepKey="deleteCustomer2"/>
32+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
33+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
34+
</after>
35+
36+
<!--Log in to Storefront as Customer 1 -->
37+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="signUp">
38+
<argument name="Customer" value="$$createCustomer$$"/>
39+
</actionGroup>
40+
41+
<!--Create an order at Storefront as Customer 1 -->
42+
<actionGroup ref="CreateOrderToPrintPageActionGroup" stepKey="createOrderToPrint">
43+
<argument name="Category" value="$$createCategory$$"/>
44+
</actionGroup>
45+
46+
<!--Go to 'print order' page by grabbed order id-->
47+
<grabFromCurrentUrl regex="~/order_id/(\d+)/~" stepKey="grabOrderIdFromURL"/>
48+
<switchToNextTab stepKey="switchToPrintPage"/>
49+
<waitForElement selector="{{SalesOrderPrintSection.isOrderPrintPage}}" stepKey="checkPrintPage"/>
50+
<openNewTab stepKey="openNewTab"/>
51+
<switchToNextTab stepKey="switchForward"/>
52+
<amOnPage url="{{StorefrontSalesOrderPrintPage.url({$grabOrderIdFromURL})}}" stepKey="duplicatePrintPage"/>
53+
54+
<!--Log out as customer 1-->
55+
<switchToNextTab stepKey="switchForward2"/>
56+
<openNewTab stepKey="openNewTab2"/>
57+
<amOnPage url="{{StorefrontCustomerSignOutPage.url}}" stepKey="signOut"/>
58+
<waitForLoadingMaskToDisappear stepKey="waitSignOutPage"/>
59+
60+
<!--Log in to Storefront as Customer 2 -->
61+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="signUp2">
62+
<argument name="Customer" value="$$createCustomer2$$"/>
63+
</actionGroup>
64+
65+
<!--Create an order at Storefront as Customer 2 -->
66+
<actionGroup ref="CreateOrderToPrintPageActionGroup" stepKey="createOrderToPrint2">
67+
<argument name="Category" value="$$createCategory$$"/>
68+
</actionGroup>
69+
70+
<!--Try to load 'print order' page with not relevant order id to be redirected to 'order history' page-->
71+
<switchToNextTab stepKey="switchToPrintPage2"/>
72+
<waitForElement selector="{{SalesOrderPrintSection.isOrderPrintPage}}" stepKey="checkPrintPage2"/>
73+
<openNewTab stepKey="openNewTab3"/>
74+
<switchToNextTab stepKey="switchForward4"/>
75+
<amOnPage url="{{StorefrontSalesOrderPrintPage.url({$grabOrderIdFromURL})}}" stepKey="duplicatePrintPage2"/>
76+
<seeElement selector="{{StorefrontCustomerOrderSection.isMyOrdersSection}}" stepKey="waitOrderHistoryPage"/>
77+
</test>
78+
</tests>

app/code/Magento/Sales/view/frontend/layout/sales_guest_print.xml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,20 @@
1212
<body>
1313
<attribute name="class" value="sales-guest-view"/>
1414
<referenceContainer name="page.main.title">
15-
<block class="Magento\Sales\Block\Order\PrintShipment" name="order.status" template="Magento_Sales::order/order_status.phtml" />
16-
<block class="Magento\Sales\Block\Order\PrintShipment" name="order.date" template="Magento_Sales::order/order_date.phtml" />
15+
<block class="Magento\Sales\Block\Order\PrintShipment"
16+
name="order.status"
17+
template="Magento_Sales::order/order_status.phtml"
18+
cacheable="false" />
19+
<block class="Magento\Sales\Block\Order\PrintShipment"
20+
name="order.date"
21+
template="Magento_Sales::order/order_date.phtml"
22+
cacheable="false" />
1723
</referenceContainer>
1824
<referenceContainer name="content">
19-
<block class="Magento\Sales\Block\Order\PrintShipment" name="sales.order.print" template="Magento_Sales::order/view.phtml">
25+
<block class="Magento\Sales\Block\Order\PrintShipment"
26+
name="sales.order.print"
27+
template="Magento_Sales::order/view.phtml"
28+
cacheable="false">
2029
<block class="Magento\Sales\Block\Order\PrintShipment" name="order_items" template="Magento_Sales::order/items.phtml">
2130
<block class="Magento\Framework\View\Element\RendererList" name="sales.order.print.renderers" as="renderer.list" />
2231
<block class="Magento\Sales\Block\Order\Totals" name="order_totals" template="Magento_Sales::order/totals.phtml">

app/code/Magento/Sales/view/frontend/layout/sales_order_print.xml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,20 @@
1212
<body>
1313
<attribute name="class" value="account"/>
1414
<referenceContainer name="page.main.title">
15-
<block class="Magento\Sales\Block\Order\PrintShipment" name="order.status" template="Magento_Sales::order/order_status.phtml" />
16-
<block class="Magento\Sales\Block\Order\PrintShipment" name="order.date" template="Magento_Sales::order/order_date.phtml" />
15+
<block class="Magento\Sales\Block\Order\PrintShipment"
16+
name="order.status"
17+
template="Magento_Sales::order/order_status.phtml"
18+
cacheable="false" />
19+
<block class="Magento\Sales\Block\Order\PrintShipment"
20+
name="order.date"
21+
template="Magento_Sales::order/order_date.phtml"
22+
cacheable="false" />
1723
</referenceContainer>
1824
<referenceContainer name="content">
19-
<block class="Magento\Sales\Block\Order\PrintShipment" name="sales.order.print" template="Magento_Sales::order/view.phtml">
25+
<block class="Magento\Sales\Block\Order\PrintShipment"
26+
name="sales.order.print"
27+
template="Magento_Sales::order/view.phtml"
28+
cacheable="false">
2029
<block class="Magento\Sales\Block\Order\PrintShipment" name="order_items" template="Magento_Sales::order/items.phtml">
2130
<block class="Magento\Framework\View\Element\RendererList" name="sales.order.print.renderers" as="renderer.list" />
2231
<block class="Magento\Sales\Block\Order\Totals" name="order_totals" template="Magento_Sales::order/totals.phtml">

app/code/Magento/User/Controller/Adminhtml/Auth/Forgotpassword.php

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66
*/
77
namespace Magento\User\Controller\Adminhtml\Auth;
88

9-
use Magento\Security\Model\SecurityManager;
9+
use Magento\Framework\App\Action\HttpGetActionInterface;
10+
use Magento\Framework\App\Action\HttpPostActionInterface;
1011
use Magento\Framework\App\ObjectManager;
12+
use Magento\Security\Model\SecurityManager;
1113
use Magento\Backend\App\Action\Context;
1214
use Magento\User\Model\UserFactory;
1315
use Magento\User\Model\ResourceModel\User\CollectionFactory;
@@ -16,14 +18,25 @@
1618
use Magento\Framework\Exception\SecurityViolationException;
1719
use Magento\User\Controller\Adminhtml\Auth;
1820
use Magento\Backend\Helper\Data;
21+
use Magento\User\Model\Spi\NotificatorInterface;
1922

20-
class Forgotpassword extends Auth
23+
/**
24+
* Initiate forgot-password process.
25+
*
26+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
27+
*/
28+
class Forgotpassword extends Auth implements HttpGetActionInterface, HttpPostActionInterface
2129
{
2230
/**
2331
* @var SecurityManager
2432
*/
2533
protected $securityManager;
2634

35+
/**
36+
* @var NotificatorInterface
37+
*/
38+
private $notificator;
39+
2740
/**
2841
* User model factory
2942
*
@@ -41,20 +54,25 @@ class Forgotpassword extends Auth
4154
* @param UserFactory $userFactory
4255
* @param SecurityManager $securityManager
4356
* @param CollectionFactory $userCollectionFactory
57+
* @param Data $backendDataHelper
58+
* @param NotificatorInterface|null $notificator
4459
*/
4560
public function __construct(
4661
Context $context,
4762
UserFactory $userFactory,
4863
SecurityManager $securityManager,
4964
CollectionFactory $userCollectionFactory = null,
50-
Data $backendDataHelper = null
65+
Data $backendDataHelper = null,
66+
?NotificatorInterface $notificator = null
5167
) {
5268
parent::__construct($context, $userFactory);
5369
$this->securityManager = $securityManager;
5470
$this->userCollectionFactory = $userCollectionFactory ?:
5571
ObjectManager::getInstance()->get(CollectionFactory::class);
5672
$this->backendDataHelper = $backendDataHelper ?:
5773
ObjectManager::getInstance()->get(Data::class);
74+
$this->notificator = $notificator
75+
?? ObjectManager::getInstance()->get(NotificatorInterface::class);
5876
}
5977

6078
/**
@@ -96,7 +114,7 @@ public function execute()
96114
$newPassResetToken = $this->backendDataHelper->generateResetPasswordLinkToken();
97115
$user->changeResetPasswordLinkToken($newPassResetToken);
98116
$user->save();
99-
$user->sendPasswordResetConfirmationEmail();
117+
$this->notificator->sendForgotPassword($user);
100118
}
101119
break;
102120
}

app/code/Magento/User/Controller/Adminhtml/User/Save.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@
1010
use Magento\Framework\Exception\AuthenticationException;
1111
use Magento\Framework\Exception\State\UserLockedException;
1212
use Magento\Security\Model\SecurityCookie;
13+
use Magento\User\Model\Spi\NotificationExceptionInterface;
1314

1415
/**
16+
* Save admin user.
17+
*
1518
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1619
*/
1720
class Save extends \Magento\User\Controller\Adminhtml\User implements HttpPostActionInterface
@@ -37,7 +40,7 @@ private function getSecurityCookie()
3740
}
3841

3942
/**
40-
* @return void
43+
* @inheritDoc
4144
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
4245
* @SuppressWarnings(PHPMD.NPathComplexity)
4346
*/
@@ -92,17 +95,19 @@ public function execute()
9295
$currentUser->performIdentityCheck($data[$currentUserPasswordField]);
9396
$model->save();
9497

95-
$model->sendNotificationEmailsIfRequired();
96-
9798
$this->messageManager->addSuccess(__('You saved the user.'));
9899
$this->_getSession()->setUserData(false);
99100
$this->_redirect('adminhtml/*/');
101+
102+
$model->sendNotificationEmailsIfRequired();
100103
} catch (UserLockedException $e) {
101104
$this->_auth->logout();
102105
$this->getSecurityCookie()->setLogoutReasonCookie(
103106
\Magento\Security\Model\AdminSessionsManager::LOGOUT_REASON_USER_LOCKED
104107
);
105108
$this->_redirect('adminhtml/*/');
109+
} catch (NotificationExceptionInterface $exception) {
110+
$this->messageManager->addErrorMessage($exception->getMessage());
106111
} catch (\Magento\Framework\Exception\AuthenticationException $e) {
107112
$this->messageManager->addError(
108113
__('The password entered for the current user is invalid. Verify the password and try again.')
@@ -121,6 +126,8 @@ public function execute()
121126
}
122127

123128
/**
129+
* Redirect to Edit form.
130+
*
124131
* @param \Magento\User\Model\User $model
125132
* @param array $data
126133
* @return void

0 commit comments

Comments
 (0)