diff --git a/code/BlogHolder.php b/code/BlogHolder.php index 48edefc..f6a0b0d 100644 --- a/code/BlogHolder.php +++ b/code/BlogHolder.php @@ -124,9 +124,7 @@ class BlogHolder extends BlogTree implements PermissionProvider { // Skip creation of default records if(!self::config()->create_default_pages) return; - $blogHolder = DataObject::get_one('BlogHolder'); - //TODO: This does not check for whether this blogholder is an orphan or not - if(!$blogHolder) { + if(!BlogHolder::get()->exists()) { $blogholder = new BlogHolder(); $blogholder->Title = "Blog"; $blogholder->URLSegment = "blog"; @@ -165,6 +163,8 @@ class BlogHolder extends BlogTree implements PermissionProvider { } } + } + if(!BlogHolder::get()->Children()->exists()){ $blog = new BlogEntry(); $blog->Title = _t('BlogHolder.SUCTITLE', "SilverStripe blog module successfully installed"); $blog->URLSegment = 'sample-blog-entry';