fix csv importer update bug when csv has less columns than before

This commit is contained in:
leogermani 2019-05-06 11:23:59 -03:00
parent e68d60c10b
commit c2870a935b
1 changed files with 2 additions and 2 deletions

View File

@ -126,15 +126,15 @@ class CSV extends Importer {
$this->handle_item_id( $values );
$this->add_log('Updating item' );
}
foreach ( $collection_definition['mapping'] as $metadatum_id => $header) {
$column = null;
foreach ( $headers as $indexRaw => $headerRaw ) {
if( $headerRaw === $header ) {
$column = $indexRaw;
}
}
if(!isset($column))
if(is_null($column))
continue;
$valueToInsert = $this->handle_encoding( $values[ $column ] );