[solved] Bug in UserList filterByGroup?

Hi everyone

a short question:
Is there an error in sorting the userlist by group in concrete5 version 8.4.4?

I have a user group "Test" and below a subgroup "Test Level 2"
A user is assigned to the group "Test Level 2".

In my own singelpage controller I simply use the example from the developer documentation:
public function view(){
      $uList = new \Concrete\Core\User\UserList();
      $uGroup = \Group::getByName('Test Level 2');

In the last line of code, however, he runs on an error:

Call to a member function getGroupPath() on null
335.           $orX->add($this->getQueryObject()->expr()->like('g.gPath', "'" . $group->getGroupPath() . "/%'"));

The $uGroup object looks correctly filled for me:
public 'gID' => string '57'
public 'gName' => string 'Test Level 2'
public 'gPath' => string '/Test/Test Level 2'

Have I forgotten something in the code or is there a bug?
Can anyone help me?
Thanks and greetings

View Replies: View Best Answer
mhawke replied on at Permalink Best Answer Reply
At first blush there appears to be a small typo. The third line of your view() function should read

'$uGroup' instead of '$group'
LennDa replied on at Permalink Reply