File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
app/code/Magento/User/Observer/Backend Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -199,11 +199,13 @@ private function _checkExpiredPassword($latestPassword)
199
199
$ message = __ ('It \'s time to <a href="%1">change your password</a>. ' , $ myAccountUrl );
200
200
}
201
201
202
- // Avoid duplicating the message
203
- $ this ->messageManager ->getMessages ()->deleteMessageByIdentifier (User::MESSAGE_ID_PASSWORD_EXPIRED );
202
+ $ messages = $ this ->messageManager ->getMessages ();
203
+
204
+ // Remove existing messages with same ID to avoid duplication
205
+ $ messages ->deleteMessageByIdentifier (User::MESSAGE_ID_PASSWORD_EXPIRED );
204
206
205
207
$ this ->messageManager ->addNoticeMessage ($ message );
206
- $ message = $ this -> messageManager -> getMessages () ->getLastAddedMessage ();
208
+ $ message = $ messages ->getLastAddedMessage ();
207
209
if ($ message ) {
208
210
$ message ->setIdentifier (User::MESSAGE_ID_PASSWORD_EXPIRED )->setIsSticky (true );
209
211
$ this ->authSession ->setPciAdminUserIsPasswordExpired (true );
You can’t perform that action at this time.
0 commit comments