File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
app/code/Magento/Newsletter/Controller/Subscriber
dev/tests/integration/testsuite/Magento/Newsletter/Controller Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -77,8 +77,9 @@ public function __construct(
77
77
protected function validateEmailAvailable ($ email )
78
78
{
79
79
$ websiteId = $ this ->_storeManager ->getStore ()->getWebsiteId ();
80
- if ($ this ->_customerSession ->getCustomerDataObject ()->getEmail () !== $ email
81
- && !$ this ->customerAccountManagement ->isEmailAvailable ($ email , $ websiteId )
80
+ if ($ this ->_customerSession ->isLoggedIn ()
81
+ && ($ this ->_customerSession ->getCustomerDataObject ()->getEmail () !== $ email
82
+ && !$ this ->customerAccountManagement ->isEmailAvailable ($ email , $ websiteId ))
82
83
) {
83
84
throw new LocalizedException (
84
85
__ ('This email address is already assigned to another user. ' )
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ public function testNewActionUsedEmail()
57
57
$ this ->dispatch ('newsletter/subscriber/new ' );
58
58
59
59
$ this ->assertSessionMessages ($ this ->equalTo ([
60
- 'There was a problem with the subscription: This email address is already assigned to another user . ' ,
60
+ 'Thank you for your subscription. ' ,
61
61
]));
62
62
$ this ->assertRedirect ($ this ->anything ());
63
63
}
You can’t perform that action at this time.
0 commit comments