mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-09-28 04:16:25 +02:00
FIX for #1294 to workaround ErrorPage fatal errors (and undefined var) when publishing.
This commit is contained in:
parent
d8915115f8
commit
785f85047f
@ -222,11 +222,10 @@ class ErrorPage extends Page {
|
|||||||
* content, so the page can be shown even when SilverStripe is not
|
* content, so the page can be shown even when SilverStripe is not
|
||||||
* functioning correctly before publishing this page normally.
|
* functioning correctly before publishing this page normally.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function doPublish() {
|
public function doPublish() {
|
||||||
parent::doPublish();
|
if (!parent::doPublish()) return false;
|
||||||
|
|
||||||
return $this->writeStaticPage();
|
return $this->writeStaticPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -255,10 +254,10 @@ class ErrorPage extends Page {
|
|||||||
$fileErrorText = _t(
|
$fileErrorText = _t(
|
||||||
'ErrorPage.ERRORFILEPROBLEM',
|
'ErrorPage.ERRORFILEPROBLEM',
|
||||||
'Error opening file "{filename}" for writing. Please check file permissions.',
|
'Error opening file "{filename}" for writing. Please check file permissions.',
|
||||||
array('filename' => $errorFile)
|
array('filename' => $filePath)
|
||||||
);
|
);
|
||||||
$this->response->addHeader('X-Status', rawurlencode($fileErrorText));
|
user_error($fileErrorText, E_USER_WARNING);
|
||||||
return $this->httpError(405);
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user