Skip to content

Commit

Permalink
lookupPersonByLogin vs lookupPersonForLogin fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Ioannis authored and arlen committed Oct 14, 2024
1 parent 520c7d7 commit 373d7db
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/src/Lib/Traits/EnrollmentControllerTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

namespace App\Lib\Traits;

use Cake\Datasource\Exception\RecordNotFoundException;
use Cake\ORM\TableRegistry;
use \App\Lib\Enum\EnrollmentActorEnum;
use \App\Model\Entity\Petition;
Expand Down Expand Up @@ -64,7 +65,11 @@ protected function getCurrentActor(?int $petitionId=null): array {
$Identifiers = TableRegistry::getTableLocator()->get('Identifiers');

$ret['person_id'] = $Identifiers->lookupPersonForLogin($ret['identifier'], $this->getCOID());
try {
$ret['person_id'] = $Identifiers->lookupPersonByLogin($this->getCOID(), $ret['identifier']);
} catch(RecordNotFoundException $e) {
$ret['person_id'] = null;
}

if(!empty($ret['person_id'])) {
$ret['type'] = 'person';
Expand Down

0 comments on commit 373d7db

Please sign in to comment.