mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
API Stop using deprecated API
This commit is contained in:
parent
c407dc0cc2
commit
6e020c663b
@ -16,7 +16,7 @@ class BlogCommentExtension extends DataExtension
|
||||
*/
|
||||
public function getExtraClass()
|
||||
{
|
||||
$blogPost = $this->owner->getParent();
|
||||
$blogPost = $this->owner->Parent();
|
||||
|
||||
if ($blogPost instanceof BlogPost) {
|
||||
if ($blogPost->isAuthor($this->owner->Author())) {
|
||||
|
@ -2,14 +2,14 @@
|
||||
<% if $Categories.exists %>
|
||||
<%t SilverStripe\\Blog\\Model\\Blog.PostedIn "Posted in" %>
|
||||
<% loop $Categories %>
|
||||
<a href="$Link" title="$Title">$Title</a><% if not Last %>, <% else %>;<% end_if %>
|
||||
<a href="$Link" title="$Title">$Title</a><% if not $IsLast %>, <% else %>;<% end_if %>
|
||||
<% end_loop %>
|
||||
<% end_if %>
|
||||
|
||||
<% if $Tags.exists %>
|
||||
<%t SilverStripe\\Blog\\Model\\Blog.Tagged "Tagged" %>
|
||||
<% loop $Tags %>
|
||||
<a href="$Link" title="$Title">$Title</a><% if not Last %>, <% else %>;<% end_if %>
|
||||
<a href="$Link" title="$Title">$Title</a><% if not $IsLast %>, <% else %>;<% end_if %>
|
||||
<% end_loop %>
|
||||
<% end_if %>
|
||||
|
||||
@ -27,8 +27,8 @@
|
||||
<%t SilverStripe\\Blog\\Model\\Blog.By "by" %>
|
||||
|
||||
<% loop $Credits %>
|
||||
<% if not $First && not $Last %>, <% end_if %>
|
||||
<% if not $First && $Last %> <%t SilverStripe\\Blog\\Model\\Blog.AND "and" %> <% end_if %>
|
||||
<% if not $IsFirst && not $IsLast %>, <% end_if %>
|
||||
<% if not $IsFirst && $IsLast %> <%t SilverStripe\\Blog\\Model\\Blog.AND "and" %> <% end_if %>
|
||||
<% if $URLSegment && not $Up.ProfilesDisabled %>
|
||||
<a href="$URL">$Name.XML</a>
|
||||
<% else %>
|
||||
|
@ -80,8 +80,6 @@ class BlogCategoryTest extends FunctionalTest
|
||||
|
||||
public function testCanView()
|
||||
{
|
||||
$this->useDraftSite();
|
||||
|
||||
$this->objFromFixture(Member::class, 'Admin');
|
||||
|
||||
$editor = $this->objFromFixture(Member::class, 'Editor');
|
||||
@ -95,8 +93,6 @@ class BlogCategoryTest extends FunctionalTest
|
||||
*/
|
||||
public function testCanEdit()
|
||||
{
|
||||
$this->useDraftSite();
|
||||
|
||||
$admin = $this->objFromFixture(Member::class, 'Admin');
|
||||
$editor = $this->objFromFixture(Member::class, 'Editor');
|
||||
|
||||
@ -118,8 +114,6 @@ class BlogCategoryTest extends FunctionalTest
|
||||
|
||||
public function testCanCreate()
|
||||
{
|
||||
$this->useDraftSite();
|
||||
|
||||
$admin = $this->objFromFixture(Member::class, 'Admin');
|
||||
$editor = $this->objFromFixture(Member::class, 'Editor');
|
||||
|
||||
@ -131,8 +125,6 @@ class BlogCategoryTest extends FunctionalTest
|
||||
|
||||
public function testCanDelete()
|
||||
{
|
||||
$this->useDraftSite();
|
||||
|
||||
$admin = $this->objFromFixture(Member::class, 'Admin');
|
||||
$editor = $this->objFromFixture(Member::class, 'Editor');
|
||||
|
||||
|
@ -95,7 +95,7 @@ class BlogPostTest extends SapphireTest
|
||||
$this->assertEquals(7, $blogpost->getCandidateAuthors()->count());
|
||||
|
||||
//Set the group to draw Members from
|
||||
Config::inst()->update(BlogPost::class, 'restrict_authors_to_group', 'blogusers');
|
||||
Config::inst()->set(BlogPost::class, 'restrict_authors_to_group', 'blogusers');
|
||||
|
||||
$this->assertEquals(3, $blogpost->getCandidateAuthors()->count());
|
||||
|
||||
|
@ -73,8 +73,6 @@ class BlogTagTest extends FunctionalTest
|
||||
*/
|
||||
public function testCanView()
|
||||
{
|
||||
$this->useDraftSite();
|
||||
|
||||
$admin = $this->objFromFixture(Member::class, 'Admin');
|
||||
$editor = $this->objFromFixture(Member::class, 'Editor');
|
||||
|
||||
@ -91,8 +89,6 @@ class BlogTagTest extends FunctionalTest
|
||||
|
||||
public function testCanEdit()
|
||||
{
|
||||
$this->useDraftSite();
|
||||
|
||||
$admin = $this->objFromFixture(Member::class, 'Admin');
|
||||
$editor = $this->objFromFixture(Member::class, 'Editor');
|
||||
|
||||
@ -114,8 +110,6 @@ class BlogTagTest extends FunctionalTest
|
||||
|
||||
public function testCanCreate()
|
||||
{
|
||||
$this->useDraftSite();
|
||||
|
||||
$admin = $this->objFromFixture(Member::class, 'Admin');
|
||||
$editor = $this->objFromFixture(Member::class, 'Editor');
|
||||
|
||||
@ -127,8 +121,6 @@ class BlogTagTest extends FunctionalTest
|
||||
|
||||
public function testCanDelete()
|
||||
{
|
||||
$this->useDraftSite();
|
||||
|
||||
$admin = $this->objFromFixture(Member::class, 'Admin');
|
||||
$editor = $this->objFromFixture(Member::class, 'Editor');
|
||||
|
||||
|
@ -50,12 +50,12 @@ class BlogTest extends SapphireTest
|
||||
*/
|
||||
$blog = $this->objFromFixture(Blog::class, 'FirstBlog');
|
||||
|
||||
Config::inst()->update(BlogPost::class, 'show_in_sitetree', true);
|
||||
Config::inst()->set(BlogPost::class, 'show_in_sitetree', true);
|
||||
$classes = $blog->getExcludedSiteTreeClassNames();
|
||||
|
||||
$this->assertNotContains(BlogPost::class, $classes, 'BlogPost class should be hidden.');
|
||||
|
||||
Config::inst()->update(BlogPost::class, 'show_in_sitetree', false);
|
||||
Config::inst()->set(BlogPost::class, 'show_in_sitetree', false);
|
||||
$classes = $blog->getExcludedSiteTreeClassNames();
|
||||
|
||||
$this->assertContains(BlogPost::class, $classes, 'BlogPost class should be hidden.');
|
||||
|
Loading…
Reference in New Issue
Block a user