tainacan csv importer - handle item ID (ref. #138)

This commit is contained in:
eduardohumberto 2018-10-11 20:09:55 -03:00
parent 71c11b8ed3
commit 7d952cacd9
2 changed files with 8 additions and 1 deletions

View File

@ -140,6 +140,10 @@ class CSV extends Importer {
return false;
}
if( $this->get_option('item_id_index') ){
$this->handle_item_id( $values );
}
foreach ( $collection_definition['mapping'] as $metadatum_id => $header) {
$metadatum = new \Tainacan\Entities\Metadatum($metadatum_id);
@ -562,6 +566,9 @@ class CSV extends Importer {
}
/**
* @param $status string the item ID
*/
private function handle_item_id( $values ){
$item_id_index = $this->set_option('item_id_index');

View File

@ -786,7 +786,7 @@ abstract class Importer {
$Tainacan_Metadata->disable_logs();
$Tainacan_Item_Metadata->disable_logs();
$item = new Entities\Item();
$item = new Entities\Item( ( $this->get_transient('item_id') ) ? $this->get_transient('item_id') : 0 );
$itemMetadataArray = [];
if( is_array( $processed_item ) ){