Skip to content

Commit e1c5225

Browse files
🔃 [EngCom] Public Pull Requests - 2.2-develop
Accepted Public Pull Requests: - #16009: fix: change "My Dashboard" to "My Account", fixes #16007 (by @DanielRuf) - #16477: Fix for #14593 (second try #16431) (by @0m3r) - #16458: Add missing showInStore attributes (by @aschrammel) - #16438: Credit memo email template file: fixing incorrect object type error (by @JosephMaxwell) - #15464: Fix "Confirmation request" email is sent on customer's newsletter unsubscribe action (by @nuzil) - #16386: Login with wishlist raise report after logout. (by @swnsma) - #16372: Wishlist update item issue (by @eduard13) - #16086: Fix false cache_lifetime usage in xml layouts (by @yuriyDne) Fixed GitHub Issues: - #14593: Press Esc Key on modal generate a jquery UI error (reported by @apomili) has been fixed in #16477 by @0m3r in 2.2-develop branch Related commits: 1. 8399f63 2. a6a17d3 3. 21f85b4 - #15218: "Confirmation request" email is sent on customer's newsletter unsubscription (reported by @densen45) has been fixed in #15464 by @nuzil in 2.2-develop branch Related commits: 1. d790198 2. 1f66421 3. f80eb03 4. 3227832 5. 69eb20f
2 parents c68a963 + 1f4ea34 commit e1c5225

File tree

20 files changed

+55
-47
lines changed

20 files changed

+55
-47
lines changed

app/code/Magento/Braintree/etc/adminhtml/system.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
<comment>http://docs.magento.com/m2/ce/user_guide/payment/braintree.html</comment>
4545
<frontend_model>Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Hint</frontend_model>
4646
</group>
47-
<group id="braintree_required" translate="label" showInDefault="1" showInWebsite="1" sortOrder="5">
47+
<group id="braintree_required" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="5">
4848
<label>Basic Braintree Settings</label>
4949
<attribute type="expanded">1</attribute>
5050
<frontend_model>Magento\Config\Block\System\Config\Form\Fieldset</frontend_model>
@@ -77,7 +77,7 @@
7777
<backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
7878
</field>
7979
</group>
80-
<group id="braintree_advanced" translate="label" showInDefault="1" showInWebsite="1" sortOrder="20">
80+
<group id="braintree_advanced" translate="label" showInDefault="1" showInWebsite="1" showInStore="0" sortOrder="20">
8181
<label>Advanced Braintree Settings</label>
8282
<frontend_model>Magento\Config\Block\System\Config\Form\Fieldset</frontend_model>
8383
<field id="braintree_cc_vault_title" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="0">
@@ -125,7 +125,7 @@
125125
<config_path>payment/braintree/sort_order</config_path>
126126
</field>
127127
</group>
128-
<group id="braintree_country_specific" translate="label" showInDefault="1" showInWebsite="1" sortOrder="30">
128+
<group id="braintree_country_specific" translate="label" showInDefault="1" showInWebsite="1" showInStore="0" sortOrder="30">
129129
<label>Country Specific Settings</label>
130130
<frontend_model>Magento\Config\Block\System\Config\Form\Fieldset</frontend_model>
131131
<field id="allowspecific" translate="label" type="allowspecific" sortOrder="200" showInDefault="1" showInWebsite="1" showInStore="0">
@@ -146,7 +146,7 @@
146146
<config_path>payment/braintree/countrycreditcard</config_path>
147147
</field>
148148
</group>
149-
<group id="braintree_paypal" translate="label" showInDefault="1" showInWebsite="1" sortOrder="40">
149+
<group id="braintree_paypal" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="40">
150150
<label>PayPal through Braintree</label>
151151
<frontend_model>Magento\Config\Block\System\Config\Form\Fieldset</frontend_model>
152152
<field id="title" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
@@ -215,7 +215,7 @@
215215
<config_path>payment/braintree_paypal/skip_order_review</config_path>
216216
</field>
217217
</group>
218-
<group id="braintree_3dsecure" translate="label" showInDefault="1" showInWebsite="1" sortOrder="41">
218+
<group id="braintree_3dsecure" translate="label" showInDefault="1" showInWebsite="1" showInStore="0" sortOrder="41">
219219
<label>3D Secure Verification Settings</label>
220220
<frontend_model>Magento\Config\Block\System\Config\Form\Fieldset</frontend_model>
221221
<field id="verify_3dsecure" translate="label" type="select" sortOrder="150" showInDefault="1" showInWebsite="1" showInStore="0">
@@ -239,7 +239,7 @@
239239
<config_path>payment/braintree/verify_specific_countries</config_path>
240240
</field>
241241
</group>
242-
<group id="braintree_dynamic_descriptor" translate="label" showInDefault="1" showInWebsite="1" sortOrder="50">
242+
<group id="braintree_dynamic_descriptor" translate="label" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="50">
243243
<label>Dynamic Descriptors</label>
244244
<comment><![CDATA[Dynamic descriptors are sent on a per-transaction basis and define what will appear on your customers credit card statements for a specific purchase.
245245
The clearer the description of your product, the less likely customers will issue chargebacks due to confusion or non-recognition.

app/code/Magento/Customer/Model/Plugin/CustomerFlushFormKey.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function aroundExecute(FlushFormKey $subject, callable $proceed, ...$args
4545
$currentFormKey = $this->dataFormKey->getFormKey();
4646
$proceed(...$args);
4747
$beforeParams = $this->session->getBeforeRequestParams();
48-
if ($beforeParams['form_key'] == $currentFormKey) {
48+
if (isset($beforeParams['form_key']) && $beforeParams['form_key'] === $currentFormKey) {
4949
$beforeParams['form_key'] = $this->dataFormKey->getFormKey();
5050
$this->session->setBeforeRequestParams($beforeParams);
5151
}

app/code/Magento/Customer/etc/frontend/page_types.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<type id="customer_account_createpassword" label="Reset a Password"/>
1212
<type id="customer_account_edit" label="Customer Account Edit Form"/>
1313
<type id="customer_account_forgotpassword" label="Customer Forgot Password Form"/>
14-
<type id="customer_account_index" label="Customer My Account Dashboard"/>
14+
<type id="customer_account_index" label="Customer My Account"/>
1515
<type id="customer_account_login" label="Customer Account Login Form"/>
1616
<type id="customer_account_logoutsuccess" label="Customer Account Logout Success"/>
1717
<type id="customer_address_form" label="Customer My Account Address Edit Form"/>

app/code/Magento/Customer/i18n/en_US.csv

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,8 +531,6 @@ Type,Type
531531
"Send Welcome Email From","Send Welcome Email From"
532532
"Are you sure you want to delete this item?","Are you sure you want to delete this item?"
533533
Addresses,Addresses
534-
"Account Dashboard","Account Dashboard"
535534
"Edit Account Information","Edit Account Information"
536535
"Password forgotten","Password forgotten"
537-
"My Dashboard","My Dashboard"
538536
"You are signed out","You are signed out"

app/code/Magento/Customer/view/frontend/layout/customer_account.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
</arguments>
2323
<block class="Magento\Customer\Block\Account\SortLinkInterface" name="customer-account-navigation-account-link">
2424
<arguments>
25-
<argument name="label" xsi:type="string" translate="true">Account Dashboard</argument>
25+
<argument name="label" xsi:type="string" translate="true">My Account</argument>
2626
<argument name="path" xsi:type="string">customer/account</argument>
2727
<argument name="sortOrder" xsi:type="number">250</argument>
2828
</arguments>

app/code/Magento/Customer/view/frontend/layout/customer_account_index.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<body>
1111
<referenceBlock name="page.main.title">
1212
<action method="setPageTitle">
13-
<argument translate="true" name="title" xsi:type="string">My Dashboard</argument>
13+
<argument translate="true" name="title" xsi:type="string">My Account</argument>
1414
</action>
1515
</referenceBlock>
1616
<referenceContainer name="content">

app/code/Magento/Newsletter/Controller/Manage/Save.php

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
* Copyright © Magento, Inc. All rights reserved.
55
* See COPYING.txt for license details.
66
*/
7+
78
namespace Magento\Newsletter\Controller\Manage;
89

910
use Magento\Customer\Api\CustomerRepositoryInterface as CustomerRepository;
11+
use Magento\Newsletter\Model\Subscriber;
1012

1113
class Save extends \Magento\Newsletter\Controller\Manage
1214
{
@@ -74,13 +76,28 @@ public function execute()
7476
$customer = $this->customerRepository->getById($customerId);
7577
$storeId = $this->storeManager->getStore()->getId();
7678
$customer->setStoreId($storeId);
77-
$this->customerRepository->save($customer);
78-
if ((boolean)$this->getRequest()->getParam('is_subscribed', false)) {
79-
$this->subscriberFactory->create()->subscribeCustomerById($customerId);
80-
$this->messageManager->addSuccess(__('We saved the subscription.'));
79+
$isSubscribedState = $customer->getExtensionAttributes()
80+
->getIsSubscribed();
81+
$isSubscribedParam = (boolean)$this->getRequest()
82+
->getParam('is_subscribed', false);
83+
if ($isSubscribedParam !== $isSubscribedState) {
84+
$this->customerRepository->save($customer);
85+
if ($isSubscribedParam) {
86+
$subscribeModel = $this->subscriberFactory->create()
87+
->subscribeCustomerById($customerId);
88+
$subscribeStatus = $subscribeModel->getStatus();
89+
if ($subscribeStatus == Subscriber::STATUS_SUBSCRIBED) {
90+
$this->messageManager->addSuccess(__('We have saved your subscription.'));
91+
} else {
92+
$this->messageManager->addSuccess(__('A confirmation request has been sent.'));
93+
}
94+
} else {
95+
$this->subscriberFactory->create()
96+
->unsubscribeCustomerById($customerId);
97+
$this->messageManager->addSuccess(__('We have removed your newsletter subscription.'));
98+
}
8199
} else {
82-
$this->subscriberFactory->create()->unsubscribeCustomerById($customerId);
83-
$this->messageManager->addSuccess(__('We removed the subscription.'));
100+
$this->messageManager->addSuccess(__('We have updated your subscription.'));
84101
}
85102
} catch (\Exception $e) {
86103
$this->messageManager->addError(__('Something went wrong while saving your subscription.'));

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,9 @@ protected function _updateCustomerSubscription($customerId, $subscribe)
596596
) {
597597
$status = self::STATUS_UNCONFIRMED;
598598
} elseif ($isConfirmNeed) {
599-
$status = self::STATUS_NOT_ACTIVE;
599+
if ($this->getStatus() != self::STATUS_SUBSCRIBED) {
600+
$status = self::STATUS_NOT_ACTIVE;
601+
}
600602
}
601603
} elseif (($this->getStatus() == self::STATUS_UNCONFIRMED) && ($customerData->getConfirmation() === null)) {
602604
$status = self::STATUS_SUBSCRIBED;

app/code/Magento/Sales/view/frontend/templates/email/items/creditmemo/default.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@
3131
</td>
3232
<td class="item-qty"><?= /* @escapeNotVerified */ $_item->getQty() * 1 ?></td>
3333
<td class="item-price">
34-
<?= /* @escapeNotVerified */ $block->getItemPrice($_item) ?>
34+
<?= /* @escapeNotVerified */ $block->getItemPrice($_item->getOrderItem()) ?>
3535
</td>
3636
</tr>

app/code/Magento/Ui/view/base/web/js/modal/modal.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,12 @@ define([
104104
/**
105105
* Escape key press handler,
106106
* close modal window
107+
* @param {Object} event - event
107108
*/
108-
escapeKey: function () {
109+
escapeKey: function (event) {
109110
if (this.options.isOpen && this.modal.find(document.activeElement).length ||
110111
this.options.isOpen && this.modal[0] === document.activeElement) {
111-
this.closeModal();
112+
this.closeModal(event);
112113
}
113114
}
114115
}

app/code/Magento/Wishlist/Model/Wishlist.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
67
namespace Magento\Wishlist\Model;
78

89
use Magento\Catalog\Api\ProductRepositoryInterface;
@@ -215,9 +216,11 @@ public function loadByCustomerId($customerId, $create = false)
215216
public function getName()
216217
{
217218
$name = $this->_getData('name');
218-
if (!strlen($name)) {
219+
220+
if ($name === null || !strlen($name)) {
219221
return $this->_wishlistData->getDefaultWishlistName();
220222
}
223+
221224
return $name;
222225
}
223226

@@ -637,6 +640,7 @@ public function updateItem($itemId, $buyRequest, $params = null)
637640
$item = null;
638641
if ($itemId instanceof Item) {
639642
$item = $itemId;
643+
$itemId = $item->getId();
640644
} else {
641645
$item = $this->getItem((int)$itemId);
642646
}

app/design/frontend/Magento/blank/i18n/en_US.csv

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
Summary,Summary
2-
"Account Dashboard","Account Dashboard"
32
"Account Information","Account Information"
43
"Address Book","Address Book"
54
Menu,Menu

app/design/frontend/Magento/luma/Magento_Customer/layout/customer_account.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<referenceContainer name="sidebar.main">
1111
<block class="Magento\Framework\View\Element\Template" name="customer_account_navigation_block" template="Magento_Theme::html/collapsible.phtml" before="-">
1212
<arguments>
13-
<argument name="block_title" translate="true" xsi:type="string">Account Dashboard</argument>
13+
<argument name="block_title" translate="true" xsi:type="string">My Account</argument>
1414
<argument name="block_css" xsi:type="string">block-collapsible-nav</argument>
1515
</arguments>
1616
<block class="Magento\Customer\Block\Account\Navigation" name="customer_account_navigation" before="-">
@@ -19,7 +19,7 @@
1919
</arguments>
2020
<block class="Magento\Customer\Block\Account\SortLinkInterface" name="customer-account-navigation-account-link">
2121
<arguments>
22-
<argument name="label" xsi:type="string" translate="true">Account Dashboard</argument>
22+
<argument name="label" xsi:type="string" translate="true">My Account</argument>
2323
<argument name="path" xsi:type="string">customer/account</argument>
2424
<argument name="sortOrder" xsi:type="number">250</argument>
2525
</arguments>

app/design/frontend/Magento/luma/i18n/en_US.csv

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,5 @@ Footer,Footer
5252
"Your shipping confirmation is below. Thank you again for your business.","Your shipping confirmation is below. Thank you again for your business."
5353
"Your Shipment #%shipment_id for Order #%order_id","Your Shipment #%shipment_id for Order #%order_id"
5454
"Update to your %store_name shipment","Update to your %store_name shipment"
55-
"Account Dashboard","Account Dashboard"
5655
"Address Book","Address Book"
5756
"Account Information","Account Information"

dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerDefaultAddresses.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class AssertCustomerDefaultAddresses extends AbstractConstraint
2424
*/
2525
public function processAssert(CustomerAccountIndex $customerAccountIndex, Address $address)
2626
{
27-
$customerAccountIndex->getAccountMenuBlock()->openMenuItem('Account Dashboard');
27+
$customerAccountIndex->getAccountMenuBlock()->openMenuItem('My Account');
2828
sleep(6);
2929
$defaultBillingAddress = explode(
3030
"\n",

dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerRedirectToDashboard.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class AssertCustomerRedirectToDashboard extends AbstractConstraint
1717
/**
1818
* Dashboard Message on account index page.
1919
*/
20-
const DASHBOARD_MESSAGE = 'My Dashboard';
20+
const DASHBOARD_MESSAGE = 'My Account';
2121

2222
/**
2323
* Constraint severeness

dev/tests/functional/tests/app/Magento/Customer/Test/TestStep/LogoutCustomerOnFrontendStep.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function run()
4949
{
5050
$this->customerAccount->open();
5151
$this->cmsIndex->getCmsPageBlock()->waitPageInit();
52-
if ($this->cmsIndex->getTitleBlock()->getTitle() === 'My Dashboard') {
52+
if ($this->cmsIndex->getTitleBlock()->getTitle() === 'My Account') {
5353
$this->cmsIndex->getLinksBlock()->openLink('Sign Out');
5454
$this->cmsIndex->getCmsPageBlock()->waitUntilTextIsVisible('Home Page');
5555
$this->cmsIndex->getCmsPageBlock()->waitPageInit();

dev/tests/integration/testsuite/Magento/Newsletter/Controller/ManageTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function testSaveAction()
5858
* Check that success message
5959
*/
6060
$this->assertSessionMessages(
61-
$this->equalTo(['We saved the subscription.']),
61+
$this->equalTo(['We have saved your subscription.']),
6262
\Magento\Framework\Message\MessageInterface::TYPE_SUCCESS
6363
);
6464
}
@@ -68,6 +68,7 @@ public function testSaveAction()
6868
*/
6969
public function testSaveActionRemoveSubscription()
7070
{
71+
7172
$this->getRequest()
7273
->setParam('form_key', 'formKey')
7374
->setParam('is_subscribed', '0');
@@ -84,7 +85,7 @@ public function testSaveActionRemoveSubscription()
8485
* Check that success message
8586
*/
8687
$this->assertSessionMessages(
87-
$this->equalTo(['We removed the subscription.']),
88+
$this->equalTo(['We have updated your subscription.']),
8889
\Magento\Framework\Message\MessageInterface::TYPE_SUCCESS
8990
);
9091
}

lib/internal/Magento/Framework/View/Element/AbstractBlock.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,17 +1064,13 @@ protected function getCacheTags()
10641064
/**
10651065
* Get block cache life time
10661066
*
1067-
* @return int|bool|null
1067+
* @return int|null
10681068
*/
10691069
protected function getCacheLifetime()
10701070
{
1071-
if (!$this->hasData('cache_lifetime')) {
1072-
return null;
1073-
}
1074-
10751071
$cacheLifetime = $this->getData('cache_lifetime');
10761072
if (false === $cacheLifetime || null === $cacheLifetime) {
1077-
return $cacheLifetime;
1073+
return null;
10781074
}
10791075

10801076
return (int)$cacheLifetime;

lib/internal/Magento/Framework/View/Test/Unit/Element/AbstractBlockTest.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -287,15 +287,6 @@ public function getCacheLifetimeDataProvider()
287287
'expectsCacheSave' => $this->never(),
288288
'expectedResult' => '',
289289
],
290-
[
291-
'cacheLifetime' => false,
292-
'dataFromCache' => 'dataFromCache',
293-
'dataForSaveCache' => '',
294-
'expectsDispatchEvent' => $this->exactly(2),
295-
'expectsCacheLoad' => $this->once(),
296-
'expectsCacheSave' => $this->never(),
297-
'expectedResult' => 'dataFromCache',
298-
],
299290
[
300291
'cacheLifetime' => 120,
301292
'dataFromCache' => 'dataFromCache',

0 commit comments

Comments
 (0)