diff --git a/app/code/Magento/AdminNotification/Controller/Adminhtml/System/Message/ListAction.php b/app/code/Magento/AdminNotification/Controller/Adminhtml/System/Message/ListAction.php index 3707100db4c85..60c34f1ed3fd9 100644 --- a/app/code/Magento/AdminNotification/Controller/Adminhtml/System/Message/ListAction.php +++ b/app/code/Magento/AdminNotification/Controller/Adminhtml/System/Message/ListAction.php @@ -1,5 +1,5 @@ getRequest()->getParam('severity'); + $default = array( + 'severity' => $severity, + 'text' => 'All recent issues have been fixed. Please refresh the screen for an update.' + ); + $messageCollection = $this->_objectManager->get( 'Magento\AdminNotification\Model\Resource\System\Message\Collection' ); @@ -23,6 +28,11 @@ public function execute() foreach ($messageCollection->getItems() as $item) { $result[] = ['severity' => $item->getSeverity(), 'text' => $item->getText()]; } + + if (empty($result)) { + $result[] = $default; + } + $this->getResponse()->representJson( $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode($result) ); diff --git a/setup/module/Magento/Setup/src/Model/WebLogger.php b/setup/module/Magento/Setup/src/Model/WebLogger.php index 28dde3a0b2b76..d25069ae5a097 100644 --- a/setup/module/Magento/Setup/src/Model/WebLogger.php +++ b/setup/module/Magento/Setup/src/Model/WebLogger.php @@ -56,7 +56,11 @@ public function __construct() */ private function open($mode) { - $this->resource = fopen($this->logFile, $mode); + if (!file_exists($this->logFile) && !is_resource($this->resource)) { + $this->resource = fopen($this->logFile, 'w'); + } else { + $this->resource = fopen($this->logFile, $mode); + } } /** @@ -66,7 +70,10 @@ private function open($mode) */ private function close() { - fclose($this->resource); + // Do a check to prevent warinig in console + if (is_resource($this->resource)) { + fclose($this->resource); + } } /**