From 35a3d79e87ef14d5c3e69bc5a74681318bdf6e4e Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 15 Oct 2010 03:04:10 +0000 Subject: [PATCH] BUGFIX Re-enabling theme in ErrorPage->doPublish() (it's usually disabled in the publication context through LeftAndMain->init()) MINOR Reverted r88633, it breaks tag in static HTML for ErrorPage->doPublish() (from r106777) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112537 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/ErrorPage.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/model/ErrorPage.php b/core/model/ErrorPage.php index c1bf42ce8..e452e25a4 100755 --- a/core/model/ErrorPage.php +++ b/core/model/ErrorPage.php @@ -122,12 +122,16 @@ class ErrorPage extends Page { function doPublish() { parent::doPublish(); - // Run the page + // Run the page (reset the theme, it might've been disabled by LeftAndMain::init()) + $oldTheme = SSViewer::current_theme(); + SSViewer::set_theme(SSViewer::current_custom_theme()); $response = Director::test(Director::makeRelative($this->Link())); + SSViewer::set_theme($oldTheme); $errorContent = $response->getBody(); + // Make the base tag dynamic. - $errorContent = preg_replace('/]+href="' . str_replace('/','\\/', Director::absoluteBaseURL()) . '"[^>]*>/i', '', $errorContent); + // $errorContent = preg_replace('/]+href="' . str_replace('/','\\/', Director::absoluteBaseURL()) . '"[^>]*>/i', '', $errorContent); // Check we have an assets base directory, creating if it we don't if(!file_exists(ASSETS_PATH)) {