mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-11 13:57:41 -08:00
Check for custom fields in Importer
This commit is contained in:
parent
116cad88a0
commit
4786c1c59f
|
@ -119,10 +119,13 @@ abstract class Importer
|
|||
// Remove any custom fields that do not exist in the header row. This prevents nulling out values that shouldn't exist.
|
||||
// In detail, we compare the lower case name of custom fields (indexed by name) to the keys in the header row. This
|
||||
// results in an array with only custom fields that are in the file.
|
||||
$this->customFields = array_intersect_key(
|
||||
array_change_key_case($this->customFields),
|
||||
array_change_key_case(array_flip($headerRow))
|
||||
);
|
||||
if ($this->customFields) {
|
||||
$this->customFields = array_intersect_key(
|
||||
array_change_key_case($this->customFields),
|
||||
array_change_key_case(array_flip($headerRow))
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
DB::transaction(function () use (&$results) {
|
||||
|
|
Loading…
Reference in a new issue