From e4c873f08bf8850fc6a0fd8fdfaf8d15d82d5eb5 Mon Sep 17 00:00:00 2001 From: Christopher Pitt Date: Fri, 15 May 2015 23:17:58 +1200 Subject: [PATCH] Stabilized TagField API --- code/model/BlogPost.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/code/model/BlogPost.php b/code/model/BlogPost.php index 499ad6f..e97213e 100644 --- a/code/model/BlogPost.php +++ b/code/model/BlogPost.php @@ -230,17 +230,19 @@ class BlogPost extends Page { TagField::create( 'Categories', _t('BlogPost.Categories', 'Categories'), - $self->Parent()->Categories()->map(), - $self->Categories()->map(), - !$self->canCreateCategories() - ), + $self->Parent()->Categories(), + $self->Categories() + ) + ->setCanCreate($self->canCreateCategories()) + ->setShouldLazyLoad(true), TagField::create( 'Tags', _t('BlogPost.Tags', 'Tags'), - $self->Parent()->Tags()->map(), - $self->Tags()->map(), - !$self->canCreateTags() - ), + $self->Parent()->Tags(), + $self->Tags() + ) + ->setCanCreate($self->canCreateTags()) + ->setShouldLazyLoad(true), $authorField, $authorNames )->setTitle('Post Options');