I've found that a facet group that becomes empty (because there isn't any content on page that requires it) won't repopulate on ajax refresh when it should be displayed.

This issue exists under the following conditions…

To reproduce:

  1. Create two facets groups based on two separate vocabularies
    1. Vocabulary a
    2. Vocabulary b
  2. Create two nodes:
    1. Node 1 contains a term from vocabulary a
    2. Node 2 contains a term from vocabulary b
  3. Display nodes via a Views 'page display'
  4. Select facet from vocabulary a
  5. Observe
  6. Deselect facet from vocabulary a
  7. Observe

Expected behaviour:

  • When the facet is deselected the facets should be displayed in their initial state.

Actual behaviour:

  • When the facet is deselected the second facet block is left empty.

Comments

lukus created an issue. See original summary.

lukus’s picture

Issue summary: View changes
lukus’s picture

Issue summary: View changes
okin’s picture

I'm facing the same issue.

When a facet get empty the content wrapper loose its ID attribute so it's not refresh anymore even if its content is in the ajax response.

I added an ID in empty_behavior_ajax_facets.inc on line 57 and it works fine.
$wrapper = '<div class="' . $class1 . ' facetapi-facet-' . $class2 . '" id="facetapi-facet-' . $class2 . '"></div>';

Tonyhawk127’s picture

Had the same issue. okin's solutions works fine. No empty facets anymore! Thanks :)

lukus’s picture

Status: Active » Needs review
StatusFileSize
new712 bytes

@okin - thanks for that .. I've rolled a patch agains 7.x-3.x

Please review.

  • eugene.ilyin committed f6b8d10 on 7.x-3.x authored by lukus
    Issue #2567729 by lukus, okin: Empty facet group won't repopulate on...
eugene.ilyin’s picture

Good catch! Thank you guys.

eugene.ilyin’s picture

Status: Needs review » Fixed
eugene.ilyin’s picture

eugene.ilyin’s picture

Status: Fixed » Closed (fixed)

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