From 4e0b92e6303b07e0c47f616c7a40c1f2538d3738 Mon Sep 17 00:00:00 2001 From: Ioannis Igoumenos Date: Fri, 5 Apr 2024 09:45:25 +0300 Subject: [PATCH] check if the co_person_id has a value before executing the query. --- Controller/GrouperGroupsController.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Controller/GrouperGroupsController.php b/Controller/GrouperGroupsController.php index 1208bcf..d73199d 100644 --- a/Controller/GrouperGroupsController.php +++ b/Controller/GrouperGroupsController.php @@ -140,10 +140,12 @@ public function beforeFilter() $roles = $this->Role->calculateCMRoles(); $co_person_id = $roles['copersonid']; // Get the act as data from the database - $args = []; - $args['conditions']['ActAsPerson.co_person_id'] = $co_person_id; - $args['contain'] = false; - $act_as_record = $this->ActAsPerson->find('first', $args); + if(!empty($co_person_id)) { + $args = []; + $args['conditions']['ActAsPerson.co_person_id'] = $co_person_id; + $args['contain'] = false; + $act_as_record = $this->ActAsPerson->find('first', $args); + } $this->set('vv_act_as_people', []); // Get ActAs configuration