mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-02 08:21:09 -08:00
Check for matching ID
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
713c9fdd6f
commit
5273408631
|
@ -39,12 +39,13 @@ class LocationImporter extends ItemImporter
|
||||||
|
|
||||||
$editingLocation = false;
|
$editingLocation = false;
|
||||||
|
|
||||||
if ($this->findCsvMatch($row, 'id')!='') {
|
$location = Location::where('name', '=', $this->findCsvMatch($row, 'name'))->first();
|
||||||
$location = Location::find($this->findCsvMatch($row, 'id'));
|
|
||||||
} else {
|
|
||||||
$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) {
|
if ($location) {
|
||||||
|
|
Loading…
Reference in a new issue