File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
app/code/Magento/AdminNotification/Controller/Adminhtml/System/Message Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,11 @@ class ListAction extends \Magento\Backend\App\AbstractAction
14
14
public function execute ()
15
15
{
16
16
$ severity = $ this ->getRequest ()->getParam ('severity ' );
17
+ $ default = [
18
+ 'severity ' => $ severity ,
19
+ 'text ' => 'All recent issues have been fixed. '
20
+ .'Please refresh the screen for an update. ' ,
21
+ ];
17
22
$ messageCollection = $ this ->_objectManager ->get (
18
23
'Magento\AdminNotification\Model\Resource\System\Message\Collection '
19
24
);
@@ -22,10 +27,17 @@ public function execute()
22
27
}
23
28
$ result = [];
24
29
foreach ($ messageCollection ->getItems () as $ item ) {
25
- $ result [] = ['severity ' => $ item ->getSeverity (), 'text ' => $ item ->getText ()];
30
+ $ result [] = [
31
+ 'severity ' => $ item ->getSeverity (),
32
+ 'text ' => $ item ->getText (),
33
+ ];
34
+ }
35
+ if (empty ($ result )) {
36
+ $ result [] = $ default ;
26
37
}
27
38
$ this ->getResponse ()->representJson (
28
- $ this ->_objectManager ->get ('Magento\Core\Helper\Data ' )->jsonEncode ($ result )
39
+ $ this ->_objectManager ->get ('Magento\Core\Helper\Data ' )
40
+ ->jsonEncode ($ result )
29
41
);
30
42
}
31
43
}
You can’t perform that action at this time.
0 commit comments