mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
FIX replaced magic config() calls to use the config::get()
This commit is contained in:
parent
0b5b71c0fb
commit
7823b40b57
@ -54,8 +54,8 @@ For example in BlogPost:
|
||||
|
||||
```php
|
||||
protected function getCandidateAuthors() {
|
||||
if($this->config()->restrict_authors_to_group) {
|
||||
return Group::get()->filter('Code', $this->config()->restrict_authors_to_group)->first()->Members();
|
||||
if($this->config()->get('restrict_authors_to_group')) {
|
||||
return Group::get()->filter('Code', $this->config()->get('restrict_authors_to_group'))->first()->Members();
|
||||
} else {
|
||||
$list = Member::get();
|
||||
$this->extend('updateCandidateAuthors', $list);
|
||||
|
@ -425,13 +425,13 @@ class Blog extends Page implements PermissionProvider
|
||||
*/
|
||||
protected function getCandidateUsers()
|
||||
{
|
||||
if ($this->config()->grant_user_access) {
|
||||
if ($this->config()->get('grant_user_access')) {
|
||||
$list = Member::get();
|
||||
$this->extend('updateCandidateUsers', $list);
|
||||
return $list;
|
||||
} else {
|
||||
return Permission::get_members_by_permission(
|
||||
$this->config()->grant_user_permission
|
||||
$this->config()->get('grant_user_permission')
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -636,7 +636,7 @@ class Blog extends Page implements PermissionProvider
|
||||
*/
|
||||
protected function assignGroup()
|
||||
{
|
||||
if (!$this->config()->grant_user_access) {
|
||||
if (!$this->config()->get('grant_user_access')) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -661,7 +661,7 @@ class Blog extends Page implements PermissionProvider
|
||||
*/
|
||||
protected function getUserGroup()
|
||||
{
|
||||
$code = $this->config()->grant_user_group;
|
||||
$code = $this->config()->get('grant_user_group');
|
||||
|
||||
$group = Group::get()->filter('Code', $code)->first();
|
||||
|
||||
@ -676,7 +676,7 @@ class Blog extends Page implements PermissionProvider
|
||||
$group->write();
|
||||
|
||||
$permission = Permission::create();
|
||||
$permission->Code = $this->config()->grant_user_permission;
|
||||
$permission->Code = $this->config()->get('grant_user_permission');
|
||||
|
||||
$group->Permissions()->add($permission);
|
||||
|
||||
|
@ -338,8 +338,8 @@ class BlogPost extends Page
|
||||
*/
|
||||
public function getCandidateAuthors()
|
||||
{
|
||||
if ($this->config()->restrict_authors_to_group) {
|
||||
return Group::get()->filter('Code', $this->config()->restrict_authors_to_group)->first()->Members();
|
||||
if ($this->config()->get('restrict_authors_to_group')) {
|
||||
return Group::get()->filter('Code', $this->config()->get('restrict_authors_to_group'))->first()->Members();
|
||||
}
|
||||
|
||||
$list = Member::get();
|
||||
|
Loading…
Reference in New Issue
Block a user