Skip to content

Commit

Permalink
Fix GroupMembers calculation for CFM-291
Browse files Browse the repository at this point in the history
  • Loading branch information
Benn Oshrin committed Jan 23, 2026
1 parent b7a0ce4 commit 80dc48e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/src/Controller/GroupMembersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
use Cake\Event\EventInterface;
use Cake\Http\Response;
use Cake\Log\Log;
use App\Lib\Util\StringUtilities;

class GroupMembersController extends StandardController {
protected array $paginate = [
Expand All @@ -56,9 +57,11 @@ public function beforeRender(EventInterface $event) {
$link = $this->getPrimaryLink(true);

if(!empty($link->value)) {
$this->set('vv_bc_parent_obj', $this->GroupMembers->Groups->get($link->value));
$this->set('vv_bc_parent_displayfield', $this->GroupMembers->Groups->getDisplayField());
$this->set('vv_bc_parent_primarykey', $this->GroupMembers->Groups->getPrimaryKey());
$model = StringUtilities::foreignKeyToClassName($link->attr);

$this->set('vv_bc_parent_obj', $this->GroupMembers->$model->get($link->value));
$this->set('vv_bc_parent_displayfield', $this->GroupMembers->$model->getDisplayField());
$this->set('vv_bc_parent_primarykey', $this->GroupMembers->$model->getPrimaryKey());
}

return parent::beforeRender($event);
Expand Down

0 comments on commit 80dc48e

Please sign in to comment.