mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 06:17:28 -08:00
Slightly better fix for requestable import bug
This commit is contained in:
parent
81880645ed
commit
192917cc84
|
@ -76,7 +76,8 @@ class AssetImporter extends ItemImporter
|
|||
}
|
||||
|
||||
$this->item['image'] = $this->findCsvMatch($row, "image");
|
||||
$this->item['requestable'] = (bool) $this->findCsvMatch($row, "requestable");
|
||||
$this->item['requestable'] = $this->fetchHumanBoolean($this->findCsvMatch($row, "requestable"));;
|
||||
$asset->requestable = $this->fetchHumanBoolean($this->findCsvMatch($row, "requestable"));
|
||||
$this->item['warranty_months'] = intval($this->findCsvMatch($row, "warranty_months"));
|
||||
$this->item['model_id'] = $this->createOrFetchAssetModel($row);
|
||||
|
||||
|
|
|
@ -443,11 +443,7 @@ abstract class Importer
|
|||
|
||||
public function fetchHumanBoolean($value)
|
||||
{
|
||||
if (($value =='1') || (strtolower($value) =='true') || (strtolower($value) =='yes'))
|
||||
{
|
||||
return '1';
|
||||
}
|
||||
return '0';
|
||||
return (int) filter_var($value, FILTER_VALIDATE_BOOLEAN);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue