FIX #22271
This commit is contained in:
parent
534db40d87
commit
94fb344bd6
@ -815,18 +815,22 @@ if ($step == 4 && $datatoimport) {
|
||||
$array_match_file_to_database = array();
|
||||
}
|
||||
|
||||
// Load source fields in input file
|
||||
// Load the source fields from input file into variable $arrayrecord
|
||||
$fieldssource = array();
|
||||
$result = $obj->import_open_file($conf->import->dir_temp.'/'.$filetoimport, $langs);
|
||||
if ($result >= 0) {
|
||||
// Read first line
|
||||
$arrayrecord = $obj->import_read_record();
|
||||
// Put into array fieldssource starting with 1.
|
||||
|
||||
// Create array $fieldssource starting with 1 with values found of first line.
|
||||
$i = 1;
|
||||
foreach ($arrayrecord as $key => $val) {
|
||||
if ($val["type"] != -1) {
|
||||
$fieldssource[$i]['example1'] = dol_trunc($val['val'], 128);
|
||||
$i++;
|
||||
} else {
|
||||
$fieldssource[$i]['example1'] = $langs->trans('Empty');
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
$obj->import_close_file();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user