Merge pull request #8133 from dhensby/pulls/3.5/php53-compat

FIX PHP 5.3 compat for referencing $this in closures
This commit is contained in:
Loz Calver 2018-06-04 16:30:21 +01:00 committed by GitHub
commit 0a4e3fc716
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1052,7 +1052,7 @@ class Member extends DataObject implements TemplateGlobalProvider {
*
* @return int[] List of group IDs
*/
protected function disallowedGroups() {
public function disallowedGroups() {
// unless the current user is an admin already OR the logged in user is an admin
if (Permission::check('ADMIN') || Permission::checkMember($this, 'ADMIN')) {
return array();
@ -1476,7 +1476,7 @@ class Member extends DataObject implements TemplateGlobalProvider {
if(Permission::check('EDIT_PERMISSIONS')) {
// Filter allowed groups
$groups = Group::get();
$disallowedGroupIDs = $this->disallowedGroups();
$disallowedGroupIDs = $self->disallowedGroups();
if ($disallowedGroupIDs) {
$groups = $groups->exclude('ID', $disallowedGroupIDs);
}