I found that Ajax facets doesn't respect values of exposed form if view works by ajax. It requires correction.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

  • eugene.ilyin committed af2fc0f on 7.x-3.x
    Issue #2531770: Ajax facets doesn't respect values of exposed form
    
eugene.ilyin’s picture

Status: Active » Fixed

Corrected. Now ajax facets should respect values of the exposed form for both modes of view (ajax/not ajax).

Status: Fixed » Closed (fixed)

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

eugene.ilyin’s picture

eugene.ilyin’s picture

veronicaSeveryn’s picture

Somehow I cannot make any of it work together.

I have a View (searchAPI index) utilizing AJAX and an exposed filters form (in a block).

The facets are on the same view page, most of them are simply Select boxes.

I have tried both Views version = "7.x-3.11 and version = "7.x-3.11+28-dev" (the DEV version contains a fix for AJAX to work with exposed filters form presented in a block).

Ajax_facets installed is version = "7.x-3.4". No extra patches applied.

But it doesn't work.

When only facets or only exposed filters utilized by itself, the view is updating via AJAX fine. But when you first use either facet or a filter, and then the other kind, the view will render no results (debuggin shows the query being built contains different values for the same field presented as exposed filter and as a facet). In addition, clicking facets will not trigger exposed filters values on the form to show the same selection, and vice versa.

veronicaSeveryn’s picture

Status: Closed (fixed) » Active
eugene.ilyin’s picture

Thx for the report. Seems this module is popular in your company. Nick also used it :)

I'll try to find time for this issue in the next several days.

veronicaSeveryn’s picture

Thanks, will be awesome :) I am trying to find a solution for a few days now, but cannot detect what is missing..

In my case the goal is to make exposed filters work with facets for the same fields: e.g. If I have an exposed filter for the field field_price_value, and I also have a facet for the same field, I need to make sure they work together when on the same view.

veronicaSeveryn’s picture

First issue I finally found was on line #201 of ajax_facets.module file. A wrong wrapper ID was created for AJAX replace commands.

So, instead of this:

$commands[] = ajax_command_replace("#$id", $content);

it should have been this:

$commands[] = ajax_command_replace("#$id" . "-wrapper", $content);

In the end, I think I have made it work somehow.. But in my case I have already been utilizing EXPOSED_FACETS module (significantly modified on my side).. So I made a few adjustments in both modules and it seems to work.. Not the best elegant solution, but until we have something better than this :) maybe you will be able to provide a better solution without extra modules involved.

  • eugene.ilyin committed 1c9648d on 7.x-3.x
    Issue #2531770 by veronicaSeveryn: Ajax facets doesn't respect values of...
eugene.ilyin’s picture

@Veronica I agree with your advice in #10 but errors in #6 and #9 isn't reproduced for me :-\

Can somebody check this problem?

eugene.ilyin’s picture

Any news here? Or maybe should I close the issue cuz problems are not reproduced?

eugene.ilyin’s picture

Status: Active » Postponed (maintainer needs more info)
eugene.ilyin’s picture

Status: Postponed (maintainer needs more info) » Fixed

Seems partially corrections are enough.

Status: Fixed » Closed (fixed)

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