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()
28
28
)->markAsRead (
29
29
$ notificationId
30
30
);
31
- $ this ->messageManager ->addSuccess (__ ('The message has been marked as Read. ' ));
31
+ $ this ->messageManager ->addSuccessMessage (__ ('The message has been marked as Read. ' ));
32
32
} catch (\Magento \Framework \Exception \LocalizedException $ e ) {
33
- $ this ->messageManager ->addError ($ e ->getMessage ());
33
+ $ this ->messageManager ->addErrorMessage ($ e ->getMessage ());
34
34
} catch (\Exception $ e ) {
35
- $ this ->messageManager ->addException (
35
+ $ this ->messageManager ->addExceptionMessage (
36
36
$ e ,
37
37
__ ("We couldn't mark the notification as Read because of an error. " )
38
38
);
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ public function execute()
23
23
{
24
24
$ ids = $ this ->getRequest ()->getParam ('notification ' );
25
25
if (!is_array ($ ids )) {
26
- $ this ->messageManager ->addError (__ ('Please select messages. ' ));
26
+ $ this ->messageManager ->addErrorMessage (__ ('Please select messages. ' ));
27
27
} else {
28
28
try {
29
29
foreach ($ ids as $ id ) {
@@ -32,13 +32,13 @@ public function execute()
32
32
$ model ->setIsRead (1 )->save ();
33
33
}
34
34
}
35
- $ this ->messageManager ->addSuccess (
35
+ $ this ->messageManager ->addSuccessMessage (
36
36
__ ('A total of %1 record(s) have been marked as Read. ' , count ($ ids ))
37
37
);
38
38
} catch (\Magento \Framework \Exception \LocalizedException $ e ) {
39
- $ this ->messageManager ->addError ($ e ->getMessage ());
39
+ $ this ->messageManager ->addErrorMessage ($ e ->getMessage ());
40
40
} catch (\Exception $ e ) {
41
- $ this ->messageManager ->addException (
41
+ $ this ->messageManager ->addExceptionMessage (
42
42
$ e ,
43
43
__ ("We couldn't mark the notification as Read because of an error. " )
44
44
);
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ public function execute()
23
23
{
24
24
$ ids = $ this ->getRequest ()->getParam ('notification ' );
25
25
if (!is_array ($ ids )) {
26
- $ this ->messageManager ->addError (__ ('Please select messages. ' ));
26
+ $ this ->messageManager ->addErrorMessage (__ ('Please select messages. ' ));
27
27
} else {
28
28
try {
29
29
foreach ($ ids as $ id ) {
@@ -32,11 +32,14 @@ public function execute()
32
32
$ model ->setIsRemove (1 )->save ();
33
33
}
34
34
}
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 )));
36
36
} catch (\Magento \Framework \Exception \LocalizedException $ e ) {
37
- $ this ->messageManager ->addError ($ e ->getMessage ());
37
+ $ this ->messageManager ->addErrorMessage ($ e ->getMessage ());
38
38
} 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
+ );
40
43
}
41
44
}
42
45
$ this ->_redirect ('adminhtml/*/ ' );
Original file line number Diff line number Diff line change @@ -31,11 +31,14 @@ public function execute()
31
31
32
32
try {
33
33
$ model ->setIsRemove (1 )->save ();
34
- $ this ->messageManager ->addSuccess (__ ('The message has been removed. ' ));
34
+ $ this ->messageManager ->addSuccessMessage (__ ('The message has been removed. ' ));
35
35
} catch (\Magento \Framework \Exception \LocalizedException $ e ) {
36
- $ this ->messageManager ->addError ($ e ->getMessage ());
36
+ $ this ->messageManager ->addErrorMessage ($ e ->getMessage ());
37
37
} 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
+ );
39
42
}
40
43
41
44
$ this ->_redirect ('adminhtml/*/ ' );
You can’t perform that action at this time.
0 commit comments