Fix story set metadata collection.

This commit is contained in:
Benoît Burnichon
2015-07-13 11:18:12 +02:00
parent afbacaa640
commit f5949cd9f4
3 changed files with 18 additions and 19 deletions

View File

@@ -676,16 +676,14 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
$values = $field->get_values();
$value = end($values);
$meta_struct_id = $field->get_meta_struct_id();
$meta_id = $value->getId();
$this->set_metadatas([[
'meta_struct_id' => $field->get_meta_struct_id(),
'meta_id' => $value->getId(),
'value' => $original_name,
]], true);
} catch (\Exception $e) {
$meta_struct_id = null;
$meta_id = null;
// Caption is not setup, ignore error
}
$this->set_metadatas([
['meta_struct_id' => $meta_struct_id, 'meta_id' => $meta_id, 'value' => $original_name],
], true);
}
$this->get_databox()->get_connection()->executeUpdate(