tainacan legacy importer - handle compound metadata
This commit is contained in:
parent
7aab768b6d
commit
7f44540240
|
@ -688,7 +688,12 @@ abstract class Importer {
|
|||
|
||||
$this->add_log('Processing item ' . $current_collection_item);
|
||||
$processed_item = $this->process_item( $current_collection_item, $collection_definition );
|
||||
if( $processed_item) {
|
||||
if( $processed_item ) {
|
||||
|
||||
if( is_bool($processed_item) ){
|
||||
return $this->next_item();
|
||||
}
|
||||
|
||||
$this->add_log('Inserting item ' . $current_collection_item);
|
||||
$this->insert( $processed_item, $current_collection );
|
||||
} else {
|
||||
|
|
|
@ -239,6 +239,11 @@ class Old_Tainacan extends Importer{
|
|||
$info = json_decode($info['body']);
|
||||
|
||||
if( !isset( $info->items ) ){
|
||||
|
||||
if( isset($info->code) && $info->code === 'empty_search' ){
|
||||
return true;
|
||||
}
|
||||
|
||||
$this->add_error_log('Error in fetch remote (' . $url_to_fetch . ')');
|
||||
$this->abort();
|
||||
return false;
|
||||
|
@ -709,7 +714,7 @@ class Old_Tainacan extends Importer{
|
|||
|
||||
if( isset( $meta->metadata->children ) ){
|
||||
foreach( $meta->metadata->children as $child ){
|
||||
$this->create_metadata( $node_metadata_old, $collection_id);
|
||||
$this->create_metadata( $child, $collection_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue