Check for matching ID
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
713c9fdd6f
commit
5273408631
1 changed files with 6 additions and 5 deletions
|
@ -39,12 +39,13 @@ class LocationImporter extends ItemImporter
|
|||
|
||||
$editingLocation = false;
|
||||
|
||||
if ($this->findCsvMatch($row, 'id')!='') {
|
||||
$location = Location::find($this->findCsvMatch($row, 'id'));
|
||||
} else {
|
||||
$location = Location::where('name', '=', $this->findCsvMatch($row, 'name'))->first();
|
||||
}
|
||||
$location = Location::where('name', '=', $this->findCsvMatch($row, 'name'))->first();
|
||||
|
||||
if ($this->findCsvMatch($row, 'id')!='') {
|
||||
// Override location if an ID was given
|
||||
\Log::debug('Finding location by ID: '.$this->findCsvMatch($row, 'id'));
|
||||
$location = Location::find($this->findCsvMatch($row, 'id'));
|
||||
}
|
||||
|
||||
|
||||
if ($location) {
|
||||
|
|
Loading…
Add table
Reference in a new issue