Skip to content

Commit 1e7d883

Browse files
committed
Merge commit 'refs/pull/922/head' of https://github.com/magento/magento2 into MAGETWO-32969-Empty-System-Message
Conflicts: app/code/Magento/AdminNotification/Controller/Adminhtml/System/Message/ListAction.php
2 parents 518964e + b23f7cd commit 1e7d883

File tree

1 file changed

+14
-2
lines changed
  • app/code/Magento/AdminNotification/Controller/Adminhtml/System/Message

1 file changed

+14
-2
lines changed

app/code/Magento/AdminNotification/Controller/Adminhtml/System/Message/ListAction.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ class ListAction extends \Magento\Backend\App\AbstractAction
1414
public function execute()
1515
{
1616
$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+
];
1722
$messageCollection = $this->_objectManager->get(
1823
'Magento\AdminNotification\Model\Resource\System\Message\Collection'
1924
);
@@ -22,10 +27,17 @@ public function execute()
2227
}
2328
$result = [];
2429
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;
2637
}
2738
$this->getResponse()->representJson(
28-
$this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($result)
39+
$this->_objectManager->get('Magento\Core\Helper\Data')
40+
->jsonEncode($result)
2941
);
3042
}
3143
}

0 commit comments

Comments
 (0)