Apply ResponseMaker to backend AJAX and cms.page.display event

This commit is contained in:
Samuel Georges 2019-11-03 08:02:28 +11:00
parent 1df8e72e4a
commit c5bd5f0e0a
2 changed files with 7 additions and 7 deletions

View File

@ -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
*/
else {
$result = $this->execPageAction($action, $params);
}
/*
* Prepare and return response

View File

@ -263,7 +263,7 @@ class Controller
*
*/
if ($event = $this->fireSystemEvent('cms.page.display', [$url, $page, $result])) {
return $event;
$result = $event;
}
/*