Merge pull request #552 from creative-commoners/pulls/3.2/reorder-fields

FIX Blog profile summary field is always inserted before the profile image field
This commit is contained in:
Dylan Wagstaff 2018-09-06 09:51:51 +12:00 committed by GitHub
commit 9d568ecdca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,6 +8,7 @@ use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\GridField\GridField; use SilverStripe\Forms\GridField\GridField;
use SilverStripe\Forms\GridField\GridFieldAddNewButton; use SilverStripe\Forms\GridField\GridFieldAddNewButton;
use SilverStripe\Forms\Tab; use SilverStripe\Forms\Tab;
use SilverStripe\Forms\TextareaField;
use SilverStripe\ORM\DataExtension; use SilverStripe\ORM\DataExtension;
use SilverStripe\Security\Member; use SilverStripe\Security\Member;
use SilverStripe\View\Parsers\URLSegmentFilter; use SilverStripe\View\Parsers\URLSegmentFilter;
@ -108,7 +109,6 @@ class BlogMemberExtension extends DataExtension
$fields->removeByName('URLSegment'); $fields->removeByName('URLSegment');
// Remove the automatically-generated posts tab. // Remove the automatically-generated posts tab.
$fields->removeFieldFromTab('Root', 'BlogPosts'); $fields->removeFieldFromTab('Root', 'BlogPosts');
// Construct a better posts tab. // Construct a better posts tab.
@ -131,6 +131,13 @@ class BlogMemberExtension extends DataExtension
$fields->addFieldToTab('Root', $tab); $fields->addFieldToTab('Root', $tab);
// Ensure blog fields are added after defaults
$fields->addFieldToTab(
'Root.Main',
TextareaField::create('BlogProfileSummary'),
'BlogProfileImage'
);
return $fields; return $fields;
} }
} }