alteracoes reunião

This commit is contained in:
Eduardo humberto 2017-11-13 10:27:44 -02:00
parent 21e71a8997
commit 7b64be6137
3 changed files with 4 additions and 18 deletions

View File

@ -138,21 +138,7 @@ class Tainacan_Item_Metadata_Entity extends Entity {
}
}
protected function validate_one_multiple_value($value) {
$metadata = $this->get_metadata();
if (empty($value) && $this->is_required())
return false;
// This method is only called for multiple Metadata
// therefore it can not be collection_key
// TODO: call fieldType validation
return true;
}
}

View File

@ -30,8 +30,8 @@ class Tainacan_Item_Metadata {
}
function insert(Tainacan_Item_Metadata_Entity $item_metadata) {
$unique = $item_metadata->get_metadata()->get_cardinality() > 1 ? false : true;
$unique = ! $item_metadata->is_multiple();
if ($unique) {
update_post_meta($item_metadata->item->get_id(), $item_metadata->metadata->get_id(), $item_metadata->get_value());

View File

@ -195,7 +195,7 @@ class TainacanItems {
}
if ( isset($args['metadata']) && is_array($args['metadata']) && !empty($args['metadata'])) {
$meta_query = $args['metadata'];
$meta_query = array_merge($args['metadata'],$meta_query);
}
$args['meta_query'] = $meta_query;