diff --git a/src/Forms/GridField/GridFieldConfig_BlogPost.php b/src/Forms/GridField/GridFieldConfig_BlogPost.php index 6679be6..e14d948 100644 --- a/src/Forms/GridField/GridFieldConfig_BlogPost.php +++ b/src/Forms/GridField/GridFieldConfig_BlogPost.php @@ -2,6 +2,7 @@ namespace SilverStripe\Blog\Forms\GridField; +use SilverStripe\Core\Injector\Injector; use SilverStripe\Lumberjack\Forms\GridFieldConfig_Lumberjack; use SilverStripe\Lumberjack\Forms\GridFieldSiteTreeState; @@ -19,6 +20,6 @@ class GridFieldConfig_BlogPost extends GridFieldConfig_Lumberjack parent::__construct($itemsPerPage); $this->removeComponentsByType(GridFieldSiteTreeState::class); - $this->addComponent(GridFieldBlogPostState::create()); + $this->addComponent(Injector::inst()->create(GridFieldBlogPostState::class)); } } diff --git a/tests/BlogFunctionalTest.php b/tests/BlogFunctionalTest.php index feb419c..71757bf 100644 --- a/tests/BlogFunctionalTest.php +++ b/tests/BlogFunctionalTest.php @@ -1,18 +1,24 @@ update('URLSegmentFilter', 'default_allow_multibyte', true); + Config::modify()->set(URLSegmentFilter::class, 'default_allow_multibyte', true); + i18n::set_locale('fa_IR'); parent::setUp(); - - i18n::set_locale('fa_IR'); } public function testBlogWithMultibyteUrl() diff --git a/tests/BlogFunctionalTest.yml b/tests/BlogFunctionalTest.yml index f4c1110..3a7b41f 100644 --- a/tests/BlogFunctionalTest.yml +++ b/tests/BlogFunctionalTest.yml @@ -1,4 +1,4 @@ -Member: +SilverStripe\Security\Member: member_a: FirstName: عبّاس Surname: آبان @@ -8,15 +8,17 @@ Member: Surname: Jones Email: bobjones@example.com -Blog: +SilverStripe\Blog\Model\Blog: blog_a: URLSegment: آبید Title: My Blog -BlogPost: +SilverStripe\Blog\Model\BlogPost: blogpost_a: Title: My Blog Post URLSegment: آبیدآبید - PublishDate: '2017-08-01 00:00:00' - Parent: =>Blog.blog_a - Authors: =>Member.member_a, =>Member.member_b + PublishDate: 2017-08-01 00:00:00 + Parent: =>SilverStripe\Blog\Model\Blog.blog_a + Authors: + - =>SilverStripe\Security\Member.member_a + - =>SilverStripe\Security\Member.member_b