FIX replaced magic config() calls to use the config::get()

This commit is contained in:
Franco Springveldt 2017-09-14 11:36:33 +12:00
parent 0b5b71c0fb
commit 7823b40b57
3 changed files with 9 additions and 9 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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();