diff --git a/inc/inc.ClassControllerCommon.php b/inc/inc.ClassControllerCommon.php index e890375a3..2f7d1afa4 100644 --- a/inc/inc.ClassControllerCommon.php +++ b/inc/inc.ClassControllerCommon.php @@ -61,12 +61,14 @@ class SeedDMS_Controller_Common { */ public function __invoke($get=array()) { $action = null; - $request = $this->getParam('request'); - if($request) { - if($request->isMethod('get')) - $action = $request->query->get('action'); - elseif($request->isMethod('post')) - $action = $request->request->get('action'); + if(!$action = $this->getParam('action')) { + $request = $this->getParam('request'); + if($request) { + if($request->isMethod('get')) + $action = $request->query->get('action'); + elseif($request->isMethod('post')) + $action = $request->request->get('action'); + } } if(!$this->callHook('preRun', get_class($this), $action ? $action : 'run')) { if($action) { @@ -78,6 +80,8 @@ class SeedDMS_Controller_Common { } } else return $this->run(); + } else { + return false; } $this->callHook('postRun', get_class($this), $action ? $action : 'run'); }