Only try to return a department if there is a matching field
This commit is contained in:
parent
304fce73fc
commit
09a102fea8
1 changed files with 15 additions and 12 deletions
|
@ -302,6 +302,7 @@ class ItemImporter extends Importer
|
||||||
*/
|
*/
|
||||||
public function createOrFetchDepartment($user_department_name)
|
public function createOrFetchDepartment($user_department_name)
|
||||||
{
|
{
|
||||||
|
if ($user_department_name!='') {
|
||||||
$department = Department::where('name', '=', $user_department_name)->first();
|
$department = Department::where('name', '=', $user_department_name)->first();
|
||||||
|
|
||||||
if ($department) {
|
if ($department) {
|
||||||
|
@ -317,6 +318,8 @@ class ItemImporter extends Importer
|
||||||
return $department->id;
|
return $department->id;
|
||||||
}
|
}
|
||||||
$this->logError($department, 'Department');
|
$this->logError($department, 'Department');
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue