Skip to content

Commit

Permalink
check if the co_person_id has a value before executing the query.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ioannis committed Apr 5, 2024
1 parent 865bbb3 commit 4e0b92e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Controller/GrouperGroupsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4e0b92e

Please sign in to comment.