mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
Fixed a bug where an error occurred when attempting to change the page type of 'Blog'
This commit is contained in:
parent
bb9beb3953
commit
c3b0401ee5
@ -546,10 +546,13 @@ class Blog extends Page implements PermissionProvider {
|
|||||||
|
|
||||||
$group = $this->getUserGroup();
|
$group = $this->getUserGroup();
|
||||||
|
|
||||||
foreach(array($this->Editors(), $this->Writers(), $this->Contributors()) as $levels) {
|
// Must check if the method exists or else an error occurs when changing page type
|
||||||
foreach($levels as $user) {
|
if ($this->hasMethod('Editors')) {
|
||||||
if(!$user->inGroup($group)) {
|
foreach(array($this->Editors(), $this->Writers(), $this->Contributors()) as $levels) {
|
||||||
$user->Groups()->add($group);
|
foreach($levels as $user) {
|
||||||
|
if(!$user->inGroup($group)) {
|
||||||
|
$user->Groups()->add($group);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user