File tree Expand file tree Collapse file tree 4 files changed +20
-14
lines changed
app/code/Magento/AdminNotification/Controller/Adminhtml/Notification Expand file tree Collapse file tree 4 files changed +20
-14
lines changed Original file line number Diff line number Diff line change @@ -28,11 +28,11 @@ public function execute()
2828 )->markAsRead (
2929 $ notificationId
3030 );
31- $ this ->messageManager ->addSuccess (__ ('The message has been marked as Read. ' ));
31+ $ this ->messageManager ->addSuccessMessage (__ ('The message has been marked as Read. ' ));
3232 } catch (\Magento \Framework \Exception \LocalizedException $ e ) {
33- $ this ->messageManager ->addError ($ e ->getMessage ());
33+ $ this ->messageManager ->addErrorMessage ($ e ->getMessage ());
3434 } catch (\Exception $ e ) {
35- $ this ->messageManager ->addException (
35+ $ this ->messageManager ->addExceptionMessage (
3636 $ e ,
3737 __ ("We couldn't mark the notification as Read because of an error. " )
3838 );
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ public function execute()
2323 {
2424 $ ids = $ this ->getRequest ()->getParam ('notification ' );
2525 if (!is_array ($ ids )) {
26- $ this ->messageManager ->addError (__ ('Please select messages. ' ));
26+ $ this ->messageManager ->addErrorMessage (__ ('Please select messages. ' ));
2727 } else {
2828 try {
2929 foreach ($ ids as $ id ) {
@@ -32,13 +32,13 @@ public function execute()
3232 $ model ->setIsRead (1 )->save ();
3333 }
3434 }
35- $ this ->messageManager ->addSuccess (
35+ $ this ->messageManager ->addSuccessMessage (
3636 __ ('A total of %1 record(s) have been marked as Read. ' , count ($ ids ))
3737 );
3838 } catch (\Magento \Framework \Exception \LocalizedException $ e ) {
39- $ this ->messageManager ->addError ($ e ->getMessage ());
39+ $ this ->messageManager ->addErrorMessage ($ e ->getMessage ());
4040 } catch (\Exception $ e ) {
41- $ this ->messageManager ->addException (
41+ $ this ->messageManager ->addExceptionMessage (
4242 $ e ,
4343 __ ("We couldn't mark the notification as Read because of an error. " )
4444 );
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ public function execute()
2323 {
2424 $ ids = $ this ->getRequest ()->getParam ('notification ' );
2525 if (!is_array ($ ids )) {
26- $ this ->messageManager ->addError (__ ('Please select messages. ' ));
26+ $ this ->messageManager ->addErrorMessage (__ ('Please select messages. ' ));
2727 } else {
2828 try {
2929 foreach ($ ids as $ id ) {
@@ -32,11 +32,14 @@ public function execute()
3232 $ model ->setIsRemove (1 )->save ();
3333 }
3434 }
35- $ this ->messageManager ->addSuccess (__ ('Total of %1 record(s) have been removed. ' , count ($ ids )));
35+ $ this ->messageManager ->addSuccessMessage (__ ('Total of %1 record(s) have been removed. ' , count ($ ids )));
3636 } catch (\Magento \Framework \Exception \LocalizedException $ e ) {
37- $ this ->messageManager ->addError ($ e ->getMessage ());
37+ $ this ->messageManager ->addErrorMessage ($ e ->getMessage ());
3838 } catch (\Exception $ e ) {
39- $ this ->messageManager ->addException ($ e , __ ("We couldn't remove the messages because of an error. " ));
39+ $ this ->messageManager ->addExceptionMessage (
40+ $ e ,
41+ __ ("We couldn't remove the messages because of an error. " )
42+ );
4043 }
4144 }
4245 $ this ->_redirect ('adminhtml/*/ ' );
Original file line number Diff line number Diff line change @@ -31,11 +31,14 @@ public function execute()
3131
3232 try {
3333 $ model ->setIsRemove (1 )->save ();
34- $ this ->messageManager ->addSuccess (__ ('The message has been removed. ' ));
34+ $ this ->messageManager ->addSuccessMessage (__ ('The message has been removed. ' ));
3535 } catch (\Magento \Framework \Exception \LocalizedException $ e ) {
36- $ this ->messageManager ->addError ($ e ->getMessage ());
36+ $ this ->messageManager ->addErrorMessage ($ e ->getMessage ());
3737 } catch (\Exception $ e ) {
38- $ this ->messageManager ->addException ($ e , __ ("We couldn't remove the messages because of an error. " ));
38+ $ this ->messageManager ->addExceptionMessage (
39+ $ e ,
40+ __ ("We couldn't remove the messages because of an error. " )
41+ );
3942 }
4043
4144 $ this ->_redirect ('adminhtml/*/ ' );
You can’t perform that action at this time.
0 commit comments