diff --git a/app/Importer/Importer.php b/app/Importer/Importer.php index ef14b75f4f..9795843f43 100644 --- a/app/Importer/Importer.php +++ b/app/Importer/Importer.php @@ -316,8 +316,8 @@ abstract class Importer $user->last_name = $user_array['last_name']; $user->username = $user_array['username']; $user->email = $user_array['email']; - $user->manager_id = $user_array['manager_id'] ?? false; - $user->department_id = $user_array['department_id'] ?? false; + $user->manager_id = $user_array['manager_id'] ?? null; + $user->department_id = $user_array['department_id'] ?? null; $user->activated = $user_array['activated']; $user->password = $this->tempPassword; diff --git a/app/Importer/UserImporter.php b/app/Importer/UserImporter.php index 4d006d1397..a30e79daed 100644 --- a/app/Importer/UserImporter.php +++ b/app/Importer/UserImporter.php @@ -53,8 +53,8 @@ class UserImporter extends ItemImporter \Log::debug('UserImporter.php Activated fetchHumanBoolean: '. $this->fetchHumanBoolean($this->findCsvMatch($row, 'activated'))); $this->item['employee_num'] = $this->findCsvMatch($row, 'employee_num'); - $this->item['department_id'] = $this->createOrFetchDepartment($this->findCsvMatch($row, 'department')); - $this->item['manager_id'] = $this->fetchManager($this->findCsvMatch($row, 'manager_first_name'), $this->findCsvMatch($row, 'manager_last_name')); + $this->item['department_id'] = $this->createOrFetchDepartment($this->findCsvMatch($row, 'department')) ?? null; + $this->item['manager_id'] = $this->fetchManager($this->findCsvMatch($row, 'manager_first_name'), $this->findCsvMatch($row, 'manager_last_name')) ?? null; $user = User::where('username', $this->item['username'])->first();