From c131c1d63d56b5e616b5e9a8a8832cd8b5e0290d Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sat, 2 Aug 2025 10:36:17 +1000 Subject: [PATCH] Fixes for importing backups --- app/Jobs/Company/CompanyImport.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Jobs/Company/CompanyImport.php b/app/Jobs/Company/CompanyImport.php index 1568d817f8..1571a3814d 100644 --- a/app/Jobs/Company/CompanyImport.php +++ b/app/Jobs/Company/CompanyImport.php @@ -1427,12 +1427,12 @@ class CompanyImport implements ShouldQueue //foreach ($this->backup_file->users as $user) foreach ((object)$this->getObject("users") as $user) { - if($user = MultiDB::hasUser(['email' => $user->email])) { //ensures that we do no inject existing users into the new account. - - if($user->account_id != $this->account->id) { - throw new ImportCompanyFailed("{$user->email} is already in the system attached to a different account"); - } + if($userX = MultiDB::hasUser(['email' => $user->email])) { //ensures that we do no inject existing users into the new account. + + if($userX->account_id != $this->account->id) { + throw new ImportCompanyFailed("{$userX->email} is already in the system attached to a different account"); + } }