_cacheTypeList = $cacheTypeList; parent::__construct($context, $taxClassService, $taxClassDataObjectFactory); } /** * Set tax ignore notification flag and redirect back * * @return \Magento\Backend\Model\View\Result\Redirect */ public function execute() { $section = $this->getRequest()->getParam('section'); if ($section) { try { $path = 'tax/notification/ignore_' . $section; $this->_objectManager->get(\Magento\Config\Model\ResourceModel\Config::class) ->saveConfig($path, 1, ScopeConfigInterface::SCOPE_TYPE_DEFAULT, 0); } catch (\Exception $e) { $this->messageManager->addError($e->getMessage()); } } // clear the block html cache $this->_cacheTypeList->cleanType('config'); $this->_eventManager->dispatch('adminhtml_cache_refresh_type', ['type' => 'config']); /** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */ $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT); return $resultRedirect->setRefererUrl(); } }