Skip to content

Commit

Permalink
FIX Blog profile summary field is always inserted before the profile …
Browse files Browse the repository at this point in the history
…image field
  • Loading branch information
robbieaverill authored and Dylan Wagstaff committed Dec 6, 2018
1 parent 17ed46c commit 233a5e6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Model/BlogMemberExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\GridField\GridField;
use SilverStripe\Forms\Tab;
use SilverStripe\Forms\TextareaField;
use SilverStripe\ORM\DataExtension;
use SilverStripe\Security\Member;
use SilverStripe\View\Parsers\URLSegmentFilter;
Expand Down Expand Up @@ -107,7 +108,6 @@ public function updateCMSFields(FieldList $fields)
$fields->removeByName('URLSegment');

// Remove the automatically-generated posts tab.

$fields->removeFieldFromTab('Root', 'BlogPosts');

// Construct a better posts tab.
Expand All @@ -127,6 +127,13 @@ public function updateCMSFields(FieldList $fields)

$fields->addFieldToTab('Root', $tab);

// Ensure blog fields are added after defaults
$fields->addFieldToTab(
'Root.Main',
TextareaField::create('BlogProfileSummary'),
'BlogProfileImage'
);

return $fields;
}
}

0 comments on commit 233a5e6

Please sign in to comment.