mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX ErrorPage::requireDefaultRecords() case where no assets directory causes an fopen() error. Ensure assets directory is created before attempting to write error page files
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@113590 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
cfcf7a5358
commit
68eebd8023
@ -60,6 +60,11 @@ class ErrorPage extends Page {
|
||||
function requireDefaultRecords() {
|
||||
parent::requireDefaultRecords();
|
||||
|
||||
// Ensure that an assets path exists before we do any error page creation
|
||||
if(!file_exists(ASSETS_PATH)) {
|
||||
mkdir(ASSETS_PATH);
|
||||
}
|
||||
|
||||
$pageNotFoundErrorPage = DataObject::get_one('ErrorPage', "\"ErrorCode\" = '404'");
|
||||
$pageNotFoundErrorPageExists = ($pageNotFoundErrorPage && $pageNotFoundErrorPage->exists()) ? true : false;
|
||||
$pageNotFoundErrorPagePath = self::get_filepath_for_errorcode(404);
|
||||
|
Loading…
Reference in New Issue
Block a user