Null if blank on user import

This commit is contained in:
snipe 2018-10-19 01:38:14 -07:00
parent 295a68bb7a
commit 304fce73fc
2 changed files with 4 additions and 4 deletions

View file

@ -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;

View file

@ -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();