FIX Clear Requirements before in-memory HTTP request for ErrorPage

For example, avoids issues where separate controllers (calling and called) operate on the same
set of files through Requirements::combine_files().
This commit is contained in:
Ingo Schommer 2013-02-05 23:34:45 +01:00
parent b19a82b693
commit 23eeb99075

View File

@ -39,6 +39,8 @@ class ErrorPage extends Page {
static public function response_for($statusCode) {
// first attempt to dynamically generate the error page
if($errorPage = DataObject::get_one('ErrorPage', "\"ErrorCode\" = $statusCode")) {
Requirements::clear();
Requirements::clear_combined_files();
return ModelAsController::controller_for($errorPage)->handleRequest(new SS_HTTPRequest('GET', ''), DataModel::inst());
}