From 0a4626c269afaf2fe4155b4334eddb6490495852 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Wed, 5 Jun 2024 16:57:21 +1200 Subject: [PATCH] ENH Use class name instead of self --- src/Forms/GridField/GridFieldAddByDBField.php | 2 +- src/Model/Blog.php | 6 +++--- tests/php/Widgets/BlogArchiveWidgetTest.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Forms/GridField/GridFieldAddByDBField.php b/src/Forms/GridField/GridFieldAddByDBField.php index ff5509e3..95613057 100644 --- a/src/Forms/GridField/GridFieldAddByDBField.php +++ b/src/Forms/GridField/GridFieldAddByDBField.php @@ -234,6 +234,6 @@ public function getHTMLFragments($gridField) $forTemplate->Fields->push($textField); $forTemplate->Fields->push($addAction); - return [$this->targetFragment => $forTemplate->renderWith(self::class)]; + return [$this->targetFragment => $forTemplate->renderWith(GridFieldAddByDBField::class)]; } } diff --git a/src/Model/Blog.php b/src/Model/Blog.php index d3aeec91..c843997f 100644 --- a/src/Model/Blog.php +++ b/src/Model/Blog.php @@ -475,7 +475,7 @@ public function canEditEditors($member = null) return $extended; } - return Permission::checkMember($member, self::MANAGE_USERS); + return Permission::checkMember($member, Blog::MANAGE_USERS); } /** @@ -499,7 +499,7 @@ public function canEditWriters($member = null) return true; } - return Permission::checkMember($member, self::MANAGE_USERS); + return Permission::checkMember($member, Blog::MANAGE_USERS); } /** @@ -523,7 +523,7 @@ public function canEditContributors($member = null) return true; } - return Permission::checkMember($member, self::MANAGE_USERS); + return Permission::checkMember($member, Blog::MANAGE_USERS); } /** diff --git a/tests/php/Widgets/BlogArchiveWidgetTest.php b/tests/php/Widgets/BlogArchiveWidgetTest.php index 6e4f7939..071dfda3 100644 --- a/tests/php/Widgets/BlogArchiveWidgetTest.php +++ b/tests/php/Widgets/BlogArchiveWidgetTest.php @@ -18,7 +18,7 @@ class BlogArchiveWidgetTest extends SapphireTest protected function setUp(): void { if (!class_exists(Widget::class)) { - self::$fixture_file = null; + BlogArchiveWidgetTest::$fixture_file = null; parent::setUp(); $this->markTestSkipped('Test requires silverstripe/widgets to be installed.'); }