getModel('pull') ->apply(JRequest::getVar('pull_id')); $msg = 'Patch successfully applied'; $type = 'message'; } catch (Exception $e) { $msg = $e->getMessage(); $type = 'error'; } $this->setRedirect(JRoute::_('index.php?option=com_patchtester&view=pulls', false), $msg, $type); } public function revert() { try { $this->getModel('pull') ->revert(JRequest::getVar('pull_id')); $msg = 'Patch successfully reverted'; $type = 'message'; } catch (Exception $e) { $msg = $e->getMessage() ?: 'Patch did not revert'; $type = 'error'; } $this->setRedirect(JRoute::_('index.php?option=com_patchtester&view=pulls', false), $msg, $type); } }