diff --git a/modules/backend/classes/Controller.php b/modules/backend/classes/Controller.php index fe929add1..a80b5b4dd 100644 --- a/modules/backend/classes/Controller.php +++ b/modules/backend/classes/Controller.php @@ -232,24 +232,24 @@ class Controller extends Extendable * Execute AJAX event */ if ($ajaxResponse = $this->execAjaxHandlers()) { - return $ajaxResponse; + $result = $ajaxResponse; } - /* * Execute postback handler */ - if ( + elseif ( ($handler = post('_handler')) && ($handlerResponse = $this->runAjaxHandler($handler)) && $handlerResponse !== true ) { - return $handlerResponse; + $result = $handlerResponse; } - /* * Execute page action */ - $result = $this->execPageAction($action, $params); + else { + $result = $this->execPageAction($action, $params); + } /* * Prepare and return response diff --git a/modules/cms/classes/Controller.php b/modules/cms/classes/Controller.php index 13e611572..9c1e05b11 100644 --- a/modules/cms/classes/Controller.php +++ b/modules/cms/classes/Controller.php @@ -263,7 +263,7 @@ class Controller * */ if ($event = $this->fireSystemEvent('cms.page.display', [$url, $page, $result])) { - return $event; + $result = $event; } /*