diff --git a/src/Model/Blog.php b/src/Model/Blog.php index fa2c936..15bae2d 100644 --- a/src/Model/Blog.php +++ b/src/Model/Blog.php @@ -142,20 +142,18 @@ class Blog extends Page implements PermissionProvider Requirements::css(BLOGGER_DIR . '/css/cms.css'); Requirements::javascript(BLOGGER_DIR . '/js/cms.js'); - $self =& $this; - - $this->beforeUpdateCMSFields(function ($fields) use ($self) { - if (!$self->canEdit()) { + $this->beforeUpdateCMSFields(function ($fields) { + if (!$this->canEdit()) { return; } $categories = GridField::create( 'Categories', _t('Blog.Categories', 'Categories'), - $self->Categories(), + $this->Categories(), GridFieldCategorisationConfig::create( 15, - $self->Categories()->sort('Title'), + $this->Categories()->sort('Title'), BlogCategory::class, 'Categories', 'BlogPosts' @@ -165,10 +163,10 @@ class Blog extends Page implements PermissionProvider $tags = GridField::create( 'Tags', _t('Blog.Tags', 'Tags'), - $self->Tags(), + $this->Tags(), GridFieldCategorisationConfig::create( 15, - $self->Tags()->sort('Title'), + $this->Tags()->sort('Title'), BlogTag::class, 'Tags', 'BlogPosts' diff --git a/src/Model/BlogPost.php b/src/Model/BlogPost.php index 9e70df0..043fc55 100644 --- a/src/Model/BlogPost.php +++ b/src/Model/BlogPost.php @@ -58,14 +58,14 @@ class BlogPost extends Page private static $db = array( 'PublishDate' => 'Datetime', 'AuthorNames' => 'Varchar(1024)', - 'Summary' => 'HTMLText', + 'Summary' => 'HTMLText' ); /** * @var array */ private static $has_one = array( - 'FeaturedImage' => 'SilverStripe\\Assets\\Image', + 'FeaturedImage' => 'SilverStripe\\Assets\\Image' ); /** @@ -74,7 +74,7 @@ class BlogPost extends Page private static $many_many = array( 'Categories' => 'SilverStripe\\Blog\\Model\\BlogCategory', 'Tags' => 'SilverStripe\\Blog\\Model\\BlogTag', - 'Authors' => 'SilverStripe\\Security\\Member', + 'Authors' => 'SilverStripe\\Security\\Member' ); /** @@ -83,7 +83,7 @@ class BlogPost extends Page private static $defaults = array( 'ShowInMenus' => false, 'InheritSideBar' => true, - 'ProvideComments' => true, + 'ProvideComments' => true ); /** @@ -112,7 +112,7 @@ class BlogPost extends Page */ private static $casting = array( 'Excerpt' => 'HTMLText', - 'Date' => 'SS_Datetime' + 'Date' => 'DBDatetime' ); /**