Skip to content

Commit

Permalink
Pipeline fix (NOJIRA)
Browse files Browse the repository at this point in the history
  • Loading branch information
Benn Oshrin committed Feb 21, 2024
1 parent 6928f05 commit 959c36e
Showing 1 changed file with 27 additions and 6 deletions.
33 changes: 27 additions & 6 deletions app/src/Model/Table/PipelinesTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ public function execute(
// (4) Sync the External Identity attributes with the Person record
$person = $this->syncPerson(
$pipeline,
$externalIdentity,
$externalIdentity->id,
$person
);

Expand Down Expand Up @@ -1396,17 +1396,38 @@ protected function syncExternalIdentity(
* Sync an External Identity to a Person.
*
* @since COmanage Registry v5.0.0
* @param Pipeline $pipeline Pipeline
* @param ExternalIdentity $externalIdentity External Identity
* @param Person $person Person
* @return Person Person
* @param Pipeline $pipeline Pipeline
* @param int $externalIdentityId External Identity ID
* @param Person $person Person
* @return Person Person
*/

protected function syncPerson(
Pipeline $pipeline,
ExternalIdentity $externalIdentity,
int $externalIdentityId,
Person $person
): Person {
// We re-pull the External Identity to account for any changes that might have
// been processed by syncExternalIdentity.
$externalIdentity = $this->Cos->People->ExternalIdentities->get(
$externalIdentityId,
['contain' => [
'Addresses',
'AdHocAttributes',
'EmailAddresses',
'Identifiers',
'Names',
'Pronouns',
'TelephoneNumbers',
'Urls',
'ExternalIdentityRoles' => [
'AdHocAttributes',
'Addresses',
'TelephoneNumbers'
]
]]
);

// Because ExternalIdentities belongTo People, we can assume we have at least
// a Person object here (it would have been created by obtainPerson if there
// wasn't one at the start of the process).
Expand Down

0 comments on commit 959c36e

Please sign in to comment.