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/src/Model/BlogObject.php b/src/Model/BlogObject.php index 677a9742..e5760e09 100644 --- a/src/Model/BlogObject.php +++ b/src/Model/BlogObject.php @@ -69,7 +69,7 @@ public function validate() } if ($this->getDuplicatesByField('Title')->count() > 0) { - $validation->addError($this->getDuplicateError(), self::DUPLICATE_EXCEPTION); + $validation->addError($this->getDuplicateError(), BlogObject::DUPLICATE_EXCEPTION); } return $validation; @@ -204,7 +204,7 @@ public function generateURLSegment($increment = 0) */ protected function getDuplicatesByField($field) { - $duplicates = DataList::create(self::class) + $duplicates = DataList::create(BlogObject::class) ->filter( [ $field => $this->$field, 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.'); }