![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/mageworx/module-seobase/Controller/Adminhtml/Customcanonical/ |
<?php /** * Copyright © 2018 MageWorx. All rights reserved. * See LICENSE.txt for license details. */ namespace MageWorx\SeoBase\Controller\Adminhtml\Customcanonical; use Magento\Framework\Exception\LocalizedException; use MageWorx\SeoBase\Controller\Adminhtml\Customcanonical; class Delete extends Customcanonical { public function execute() { $resultRedirect = $this->resultRedirectFactory->create(); $id = $this->getRequest()->getParam('id'); if ($id) { try { $this->customCanonicalRepository->deleteById($id); $this->messageManager->addSuccessMessage(__('The Custom Canonical has been deleted.')); } catch (LocalizedException $e) { $this->messageManager->addErrorMessage($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addErrorMessage( __('We can\'t delete the Custom Canonical right now. Please review the log and try again.') ); $this->logger->critical($e); } } else { $this->messageManager->addErrorMessage(__('Custom Canonical is not found.')); } $resultRedirect->setPath('mageworx_seobase/*/index'); return $resultRedirect; } }