mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
parent
5d3b896297
commit
7769f03ccc
@ -197,8 +197,6 @@ class Controller extends RequestHandler implements TemplateGlobalProvider {
|
||||
* @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 @@ class Controller extends RequestHandler implements TemplateGlobalProvider {
|
||||
} 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 @@ class RequestHandler extends ViewableData {
|
||||
|
||||
$actionRes = $this->$action($request);
|
||||
|
||||
$res = $this->extend('afterCallActionHandler', $request, $action);
|
||||
$res = $this->extend('afterCallActionHandler', $request, $action, $actionRes);
|
||||
if ($res) return reset($res);
|
||||
|
||||
return $actionRes;
|
||||
|
Loading…
Reference in New Issue
Block a user