diff --git a/Controller/Adminhtml/Region/Delete.php b/Controller/Adminhtml/Region/Delete.php index 78a1f1d..92afdb7 100644 --- a/Controller/Adminhtml/Region/Delete.php +++ b/Controller/Adminhtml/Region/Delete.php @@ -36,17 +36,17 @@ public function execute() $model->load($region_id); $region_name = $model->getDefaultName(); $model->delete(); - $this->messageManager->addSuccess(__('The '.$region_name.' Region has been deleted.')); + $this->messageManager->addSuccessMessage(__('The '.$region_name.' Region has been deleted.')); return $resultRedirect->setPath('*/*/'); } catch (\Exception $e) { // display error message - $this->messageManager->addError($e->getMessage()); + $this->messageManager->addErrorMessage($e->getMessage()); // go back to edit form return $resultRedirect->setPath('*/*/edit', ['region_id' => $region_id]); } } // display error message - $this->messageManager->addError(__('Region to delete was not found.')); + $this->messageManager->addErrorMessage(__('Region to delete was not found.')); // go to grid return $resultRedirect->setPath('*/*/'); } diff --git a/Controller/Adminhtml/Region/Edit.php b/Controller/Adminhtml/Region/Edit.php index c8906f4..2b95244 100644 --- a/Controller/Adminhtml/Region/Edit.php +++ b/Controller/Adminhtml/Region/Edit.php @@ -78,7 +78,7 @@ public function execute() if ($id && $id > 0) { $model->load($id); if (!$model->getRegionId()) { - $this->messageManager->addError(__('This region no longer exists.')); + $this->messageManager->addErrorMessage(__('This region no longer exists.')); /** \Magento\Backend\Model\View\Result\Redirect $resultRedirect */ $resultRedirect = $this->resultRedirectFactory->create(); return $resultRedirect->setPath('*/*/'); diff --git a/Controller/Adminhtml/Region/MassDelete.php b/Controller/Adminhtml/Region/MassDelete.php index 928e9b1..1f53b54 100644 --- a/Controller/Adminhtml/Region/MassDelete.php +++ b/Controller/Adminhtml/Region/MassDelete.php @@ -60,7 +60,7 @@ public function execute() $page->delete(); } - $this->messageManager->addSuccess(__('A total of %1 record(s) have been deleted.', $collectionSize)); + $this->messageManager->addSuccessMessage(__('A total of %1 record(s) have been deleted.', $collectionSize)); /** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */ $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT); diff --git a/Controller/Adminhtml/Region/Save.php b/Controller/Adminhtml/Region/Save.php index 7fa17c8..0625457 100644 --- a/Controller/Adminhtml/Region/Save.php +++ b/Controller/Adminhtml/Region/Save.php @@ -54,7 +54,7 @@ public function execute() /** @var \PHPCuong\Region\Model\Region $model */ $model = $this->_objectManager->create('PHPCuong\Region\Model\Region')->load($id); if (!$model->getRegionId() && $id) { - $this->messageManager->addError(__('This region no longer exists.')); + $this->messageManager->addErrorMessage(__('This region no longer exists.')); return $resultRedirect->setPath('*/*/'); } @@ -62,16 +62,16 @@ public function execute() try { $model->save(); - $this->messageManager->addSuccess(__('You saved the region.')); + $this->messageManager->addSuccessMessage(__('You saved the region.')); if ($this->getRequest()->getParam('back')) { return $resultRedirect->setPath('*/*/edit', ['region_id' => $model->getRegionId()]); } return $resultRedirect->setPath('*/*/'); } catch (LocalizedException $e) { - $this->messageManager->addError($e->getMessage()); + $this->messageManager->addErrorMessage($e->getMessage()); } catch (\Exception $e) { - $this->messageManager->addException($e, __('Something went wrong while saving the region.')); + $this->messageManager->addExceptionMessage($e, __('Something went wrong while saving the region.')); } $this->_getSession()->setFormData($data); diff --git a/composer.json b/composer.json index 9869780..ca6cb0d 100644 --- a/composer.json +++ b/composer.json @@ -10,12 +10,11 @@ "Manage regions in magento2 addresses" ], "require": { - "php": "~5.6.0|7.0.2|7.0.4|~7.0.6|~7.1.0", - "magento/module-backend": "100.0.*|100.1.*|100.2.*", - "magento/framework": "100.0.*|100.1.*|101.0.*" + "magento/module-backend": "100.0.*|100.1.*|100.2.*|^101.0", + "magento/framework": "100.0.*|100.1.*|101.0.*|^102.0" }, "type": "magento2-module", - "version": "2.2.1", + "version": "2.3.0", "license": [ "OSL-3.0", "AFL-3.0"