Merge pull request #1039 from dnadesign/fixpopcurrentwarning

FIX ensure controller stack is updated when execution halted by an exception
This commit is contained in:
Stig Lindqvist 2014-07-21 16:10:05 +12:00
commit 5107b08ac1

View File

@ -193,8 +193,18 @@ class ContentController extends Controller {
}
Director::set_current_page($this->data());
try {
$response = parent::handleRequest($request, $model);
Director::set_current_page(null);
} catch(SS_HTTPResponse_Exception $e) {
$this->popCurrent();
Director::set_current_page(null);
throw $e;
}
}
return $response;