Merge branch 'develop' into feature/facets_ES

This commit is contained in:
vnmedeiros 2019-04-16 11:50:36 -03:00
commit a02ac419a8
1 changed files with 9 additions and 8 deletions

View File

@ -122,19 +122,20 @@ class REST_Taxonomies_Controller extends REST_Controller {
$item_arr['collections_ids'] = [];
$taxonomy = get_taxonomy( $item->get_db_identifier() );
foreach ($taxonomy->object_type as $slug) {
$tax_collection = Repositories\Collections::get_instance()->fetch_by_db_identifier($slug);
if ( $tax_collection instanceof \Tainacan\Entities\Collection ) {
$item_arr['collections'][] = $tax_collection->_toArray();
$item_arr['collections_ids'][] = $tax_collection->get_id();
if (is_object($taxonomy) && isset($taxonomy->object_type) && is_array($taxonomy->object_type)) {
foreach ($taxonomy->object_type as $slug) {
$tax_collection = Repositories\Collections::get_instance()->fetch_by_db_identifier($slug);
if ( $tax_collection instanceof \Tainacan\Entities\Collection ) {
$item_arr['collections'][] = $tax_collection->_toArray();
$item_arr['collections_ids'][] = $tax_collection->get_id();
}
}
}
} else {
$attributes_to_filter = $request['fetch_only'];