From 3433726a49d384494c03e7b64fb28b2a8ab4ad2f Mon Sep 17 00:00:00 2001 From: cam-findlay Date: Mon, 12 Nov 2012 13:43:19 +1300 Subject: [PATCH] Update code/BlogHolder.php corrects the blog ownership has_one relationship to store the correct $member->ID value. --- code/BlogHolder.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/code/BlogHolder.php b/code/BlogHolder.php index 000b356..7e6d4c5 100644 --- a/code/BlogHolder.php +++ b/code/BlogHolder.php @@ -36,13 +36,14 @@ class BlogHolder extends BlogTree implements PermissionProvider { function getCMSFields() { $blogOwners = $this->blogOwners(); - - SiteTree::disableCMSFieldsExtensions(); - $fields = parent::getCMSFields(); - SiteTree::enableCMSFieldsExtensions(); - + + //sets the ID and Name Map for Blog Ownership + $owners = new DropdownField('OwnerID', 'Blog owner', $blogOwners->map('ID', 'Name')->toArray()); + $owners->setEmptyString('(None)'); + $owners->setHasEmptyDefault(true); + $fields->addFieldToTab('Root.Main', new CheckboxField('TrackBacksEnabled', 'Enable TrackBacks'), "Content"); - $fields->addFieldToTab('Root.Main', new DropdownField('OwnerID', 'Blog owner', array_merge(array('' => "(None)"), $blogOwners->map('ID', 'Name')->toArray())), "Content"); + $fields->addFieldToTab('Root.Main', $owners, "Content"); $fields->addFieldToTab('Root.Main', new CheckboxField('AllowCustomAuthors', 'Allow non-admins to have a custom author field'), "Content"); $fields->addFieldToTab("Root.Main", new CheckboxField("ShowFullEntry", "Show Full Entry"), "Content");