Problem/Motivation

I have a website running the latest version of Drupal. When I update the search_api_decoupled module to alpha41, I see the new Filters option in the endpoint configuration screen. I can click the button to add a new filter and configure the filter in the modal. However, after saving the filter configuration, the endpoint configuration form does not update to show the newly saved filter.

Steps to reproduce

I have attempted to add a filter to an existing endpoint (created before the update) and to a new endpoint (created after the update). I have tried different fields on which the filter is applied. I have tried different filter rules (greater than, equal to, etc.). I have tried setting the filter to be exposed or not exposed. No variation yields a successfully added filter.

There are no errors reported in the browser console or in the Drupal log.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

aaronpinero created an issue. See original summary.

a.dmitriiev’s picture

Status: Active » Postponed (maintainer needs more info)
StatusFileSize
new40.58 KB

Hi @aaronpinero,

Thank you for reporting the problem. Unfortunately, I can't reproduce the error. I am afraid, I will need more information on how to reproduce the bug. I have tried to create the filter for existing endpoint and also for a newly created (it is only possible actually to add the filter for the endpoint that already exists, meaning it has to be saved first). I see this:

filters of endpoint

I can also add multiple endpoints.

I assume we are talking about the admin UI here, or do you mean that the filters are not displayed in the search form in frontend?

aaronpinero’s picture

It's possible I am missing something about the filter creation, but I cannot get the filters to actually create. I am attaching a screen capture showing what I am seeing. No errors are reported and the status message is green, but no filters are actually ever saved. I have verified that this is not just a UI problem. The resulting endpoint show all results with nothing filtered out.

kurttrowbridge’s picture

For what little it's worth, I was pairing with another developer (Drupal username nikki-peel) this morning and we saw the same behavior as Aaron, while following the same process as his video. (We didn't end up needing to add a filter and thus downgraded to alpha39.)

a.dmitriiev’s picture

Status: Postponed (maintainer needs more info) » Active

ok, I was able to reproduce the bug on a clean Drupal installation. I will try to find out what is going on.

a.dmitriiev’s picture

Status: Active » Needs review

I was always testing with UI submodule enabled, and that played a dirty trick on this filters feature, as the Entity definition without UI module enabled didn't support plugin collections (filters is a plugin collection). I have moved interface to the main entity definition and now it is possible to add/edit/remove filters with UI submodule enabled.

Please review MR.

aaronpinero’s picture

I patched the module using the plain diff from the MR and this appears to have fixed the issue. I am able to save filters, and I verified that the resulting endpoint results were being filtered as expected.

a.dmitriiev’s picture

Status: Needs review » Reviewed & tested by the community

I believe that comment #8 can be considered as RTBC.

a.dmitriiev’s picture

Status: Reviewed & tested by the community » Fixed

Merged. This will be part of alpha42

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.