Skip to content
Permalink
Browse files

BUG Remove duplicate extension hook

Fixes #5170
Reverts #3355
  • Loading branch information
Damian Mooyman
Damian Mooyman committed Mar 13, 2016
1 parent 5d3b896 commit 7769f03ccc0300510daffdfe2bce7723f2193ee1
Showing with 16 additions and 5 deletions.
  1. +15 −4 control/Controller.php
  2. +1 −1 control/RequestHandler.php
@@ -197,8 +197,6 @@ public function handleRequest(SS_HTTPRequest $request, DataModel $model) {
* @return HTMLText|SS_HTTPResponse
*/
protected function handleAction($request, $action) {
$this->extend('beforeCallActionHandler', $request, $action);
foreach($request->latestParams() as $k => $v) {
if($v || !isset($this->urlParams[$k])) $this->urlParams[$k] = $v;
}
@@ -215,9 +213,22 @@ protected function handleAction($request, $action) {
} else {
return $result;
}
} else {
return $this->getViewer($action)->process($this);
}
// Fall back to index action with before/after handlers
$beforeResult = $this->extend('beforeCallActionHandler', $request, $action);
if ($beforeResult) {
return reset($beforeResult);
}
$result = $this->getViewer($action)->process($this);
$afterResult = $this->extend('afterCallActionHandler', $request, $action, $result);
if($afterResult) {
return reset($afterResult);
}
return $result;
}
/**
@@ -287,7 +287,7 @@ protected function handleAction($request, $action) {
$actionRes = $this->$action($request);
$res = $this->extend('afterCallActionHandler', $request, $action);
$res = $this->extend('afterCallActionHandler', $request, $action, $actionRes);
if ($res) return reset($res);
return $actionRes;

0 comments on commit 7769f03

Please sign in to comment.
You can’t perform that action at this time.