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 @@ -196,11 +196,13 @@ private function _checkExpiredPassword($latestPassword)
196
196
$ message = __ ('It \'s time to <a href="%1">change your password</a>. ' , $ myAccountUrl );
197
197
}
198
198
199
- // Avoid duplicating the message
200
- $ this ->messageManager ->getMessages ()->deleteMessageByIdentifier (User::MESSAGE_ID_PASSWORD_EXPIRED );
199
+ $ messages = $ this ->messageManager ->getMessages ();
200
+
201
+ // Remove existing messages with same ID to avoid duplication
202
+ $ messages ->deleteMessageByIdentifier (User::MESSAGE_ID_PASSWORD_EXPIRED );
201
203
202
204
$ this ->messageManager ->addNoticeMessage ($ message );
203
- $ message = $ this -> messageManager -> getMessages () ->getLastAddedMessage ();
205
+ $ message = $ messages ->getLastAddedMessage ();
204
206
if ($ message ) {
205
207
$ message ->setIdentifier (User::MESSAGE_ID_PASSWORD_EXPIRED )->setIsSticky (true );
206
208
$ this ->authSession ->setPciAdminUserIsPasswordExpired (true );
You can’t perform that action at this time.
0 commit comments