Skip to content

Repository Filters doesn't work with Elasticpress 5.x #952

@erickml0

Description

@erickml0

Bug description

When you have filters in the repository elements it doesn’t show the filters even if there’s info, something like this (Just in repository elements):

Image

But in your collection’s filters it works without troubles

Image

As I said, this filter is a metadata that contains info in several collections (Type: selection list, but with Text and Taxonomy also appears this mistake).

Versions:

Elasticsearch: 7.10.2
Elasticpress: 5.2.0
Tainacan: 0.21.15

Apache log

[Wed May 07 18:01:02.295148 2025] [php:error] [pid 2045870:tid 2045870] [client] PHP Fatal error:  Uncaught Error: Cannot use object of type Tainacan\\Entities\\Metadatum as array in /var/www/html/acervo/wp-content/plugins/tainacan/classes/class-tainacan-elastic-press-lte-5.2.0.php:302\nStack trace:\n#0 /var/www/html/acervo/wp-content/plugins/tainacan/classes/class-tainacan-elastic-press-lte-5.2.0.php(185): Tainacan\\Elastic_Press_lte4->add_items_args()\n#1 /var/www/html/acervo/wp-includes/class-wp-hook.php(324): Tainacan\\Elastic_Press_lte4->filter_args()\n#2 /var/www/html/acervo/wp-includes/plugin.php(205): WP_Hook->apply_filters()\n#3 /var/www/html/acervo/wp-content/plugins/tainacan/classes/repositories/class-tainacan-items.php(377): apply_filters()\n#4 /var/www/html/acervo/wp-content/plugins/tainacan/classes/api/endpoints/class-tainacan-rest-items-controller.php(698): Tainacan\\Repositories\\Items->fetch()\n#5 /var/www/html/acervo/wp-includes/rest-api/class-wp-rest-server.php(1292): Tainacan\\API\\EndPoints\\REST_Items_Controller->get_items()\n#6 /var/www/html/acervo/wp-includes/rest-api/class-wp-rest-server.php(1125): WP_REST_Server->respond_to_request()\n#7 /var/www/html/acervo/wp-includes/rest-api/class-wp-rest-server.php(439): WP_REST_Server->dispatch()\n#8 /var/www/html/acervo/wp-includes/rest-api.php(459): WP_REST_Server->serve_request()\n#9 /var/www/html/acervo/wp-includes/class-wp-hook.php(324): rest_api_loaded()\n#10 /var/www/html/acervo/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()\n#11 /var/www/html/acervo/wp-includes/plugin.php(565): WP_Hook->do_action()\n#12 /var/www/html/acervo/wp-includes/class-wp.php(418): do_action_ref_array()\n#13 /var/www/html/acervo/wp-includes/class-wp.php(818): WP->parse_request()\n#14 /var/www/html/acervo/wp-includes/functions.php(1342): WP->main()\n#15 /var/www/html/acervo/wp-blog-header.php(16): wp()\n#16 /var/www/html/acervo/index.php(17): require('...')\n#17 {main}\n  thrown in /var/www/html/acervo/wp-content/plugins/tainacan/classes/class-tainacan-elastic-press-lte-5.2.0.php on line 302, referer: https://repositorio-acervo.com/elementos/?search=felix&perpage=12&view_mode=table&paged=1&order=ASC&orderby=date&fetch_only=thumbnail%2Ctitle%2Cdescription&fetch_only_meta=179791%2C168696&metaquery%5B0%5D%5Bkey%5D=19&metaquery%5B0%5D%5Bvalue%5D%5B0%5D=6&metaquery%5B0%5D%5Bcompare%5D=IN

Additional info

Sync log of Elasticpress doesn't show any mistake.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Next Release[Type] BugIssues that indicate incorrect or unexpected operation of the plugin.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions