From d1ff45519bea04d305fd389ebaa250096a35f209 Mon Sep 17 00:00:00 2001 From: Sami Mokaddem Date: Thu, 19 Jan 2023 15:41:17 +0100 Subject: [PATCH] fix: [command:fastUserEmrolment] Typo in condition showing the wrong warning for the faulty entity --- src/Command/FastUserEnrolmentCommand.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Command/FastUserEnrolmentCommand.php b/src/Command/FastUserEnrolmentCommand.php index 2fee372..293469c 100644 --- a/src/Command/FastUserEnrolmentCommand.php +++ b/src/Command/FastUserEnrolmentCommand.php @@ -201,11 +201,11 @@ class FastUserEnrolmentCommand extends Command foreach ($data as $entry) { $individual = $this->getIndividualByEmail($entry[$this->individual_email_column]); $organisation = $this->getOrganisationsByName($entry[$this->organisation_name_column]); - if (empty($individual)) { + if (empty($organisation)) { $this->io->error("Error while parsing source data. Could not find organisation with name: " . $entry[$this->organisation_name_column]); die(1); } - if (empty($organisation)) { + if (empty($individual)) { $this->io->error("Error while parsing source data. Could not find individuals with email: " . $entry[$this->individual_email_column]); die(1); } @@ -215,8 +215,6 @@ class FastUserEnrolmentCommand extends Command 'type' => $this->alignment_type, 'individual_email' => $entry[$this->individual_email_column], ]; - $new['individual_id'] = $new['individual_id']['id']; - $new['organisation_id'] = $new['organisation_id']['id']; $updatedData[] = $new; } return $updatedData;