Skip to content

Commit 5d4a083

Browse files
author
Michal Malinowski
committed
fixed empty system message on not refresheg page with previous system warrning
1 parent c913c94 commit 5d4a083

File tree

1 file changed

+7
-0
lines changed
  • app/code/Magento/AdminNotification/Controller/Adminhtml/System/Message

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ class ListAction extends \Magento\Backend\App\AbstractAction
1313
public function execute()
1414
{
1515
$severity = $this->getRequest()->getParam('severity');
16+
$default = array(
17+
'severity' => $severity,
18+
'text' => 'All recent issues have been fixed. Please refresh the screen for an update.'
19+
);
1620
$messageCollection = $this->_objectManager->get(
1721
'Magento\AdminNotification\Model\Resource\System\Message\Collection'
1822
);
@@ -23,6 +27,9 @@ public function execute()
2327
foreach ($messageCollection->getItems() as $item) {
2428
$result[] = ['severity' => $item->getSeverity(), 'text' => $item->getText()];
2529
}
30+
if (empty($result)) {
31+
$result[] = $default;
32+
}
2633
$this->getResponse()->representJson(
2734
$this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($result)
2835
);

0 commit comments

Comments
 (0)