From 87971399e5faee4c310f9675e1b2893de6fc50c2 Mon Sep 17 00:00:00 2001 From: Scott Koranda Date: Fri, 12 Apr 2024 12:22:57 -0500 Subject: [PATCH] Transmogrify handle empty OrgId affiliation (CFM-384) --- app/src/Command/TransmogrifyCommand.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/Command/TransmogrifyCommand.php b/app/src/Command/TransmogrifyCommand.php index d8ecb4bcd..48c119f7a 100644 --- a/app/src/Command/TransmogrifyCommand.php +++ b/app/src/Command/TransmogrifyCommand.php @@ -1371,8 +1371,10 @@ protected function split_external_identity(array $origRow, array $row) { // lookup the CO ID in the cache, however by the time we've been called // affiliation has been null'd out (since we're moving it to the role row). // So shove it back in before calling map_affiliation_type. - $row['affiliation'] = $origRow['affiliation']; - $roleRow['affiliation_type_id'] = $this->map_affiliation_type($row); + if(!empty($origRow['affiliation'])) { + $row['affiliation'] = $origRow['affiliation']; + $roleRow['affiliation_type_id'] = $this->map_affiliation_type($row); + } // Fix up changelog // Since we're creating a new row, we have to manually fix up booleans