diff --git a/src/classes/api/endpoints/class-tainacan-rest-items-controller.php b/src/classes/api/endpoints/class-tainacan-rest-items-controller.php index 576586bb3..5b7c7ba9c 100644 --- a/src/classes/api/endpoints/class-tainacan-rest-items-controller.php +++ b/src/classes/api/endpoints/class-tainacan-rest-items-controller.php @@ -569,6 +569,8 @@ class REST_Items_Controller extends REST_Controller { private function get_items_permissions_check_for_taxonomy($taxonomies) { foreach ($taxonomies as $tax) { + if( !isset($tax['taxonomy']) ) + return false; $taxonomy = \tainacan_taxonomies()->fetch_by_db_identifier( $tax['taxonomy'] ); if( $taxonomy instanceof Entities\Taxonomy ) { diff --git a/src/views/admin/components/search/filters-items-list.vue b/src/views/admin/components/search/filters-items-list.vue index b1efd3383..c74356c5b 100644 --- a/src/views/admin/components/search/filters-items-list.vue +++ b/src/views/admin/components/search/filters-items-list.vue @@ -384,9 +384,7 @@ this.prepareFilters(); }); if (this.isUsingElasticSearch) { - this.$eventBusSearch.$on('isLoadingItems', isLoadingItems => { - this.isLoadingItems = isLoadingItems; - }); + this.$eventBusSearch.$on('isLoadingItems', this.updateIsLoadingItems); } }, beforeDestroy() { @@ -405,7 +403,7 @@ this.$eventBusSearch.$off('hasToPrepareMetadataAndFilters'); if (this.isUsingElasticSearch) - this.$eventBusSearch.$off('isLoadingItems'); + this.$eventBusSearch.$off('isLoadingItems', this.updateIsLoadingItems); }, methods: { @@ -482,6 +480,9 @@ this.repositoryFiltersSearchCancel = source; }); } + }, + updateIsLoadingItems(isLoadingItems) { + this.isLoadingItems = isLoadingItems } } }