My use case

I have a date facet working on the created property for nodes looking something like this:

  • June 20, 2012 (20)
    • 10 AM (15)
    • 9 AM (5)
  • June 19, 2012 (10)
    • 5 AM (7)
    • 4 AM (3)

The problem

If I first click on "June 20, 2012" everything is fine. But when I try to narrow down on "10 AM" it doesn't give the intended result back.
The problem does not occur when disabling facetapi_pretty_paths.module.

The solution

When the module is traversing all segments it does so from right to left (to find the search base path last). It turns out that the order we add filters in, is important for some facets. I think this is a general problem and nothing specific to date facets, like in my case.

So we have to reverse the filters when re-assigning them to $_GET. The attached patch (very simple) fixes the problem.

Comments

dasjo’s picture

nice one, sounds good, thank you for reporting and proposing the fix!

i hope i can test it soon, if others want to speed up the process feel free to review and set to RTBC if appropriate :)

nick_vh’s picture

This patch does not seem to work for me, I'm looking into the possible problems
The facet never gets selected as active at all.

nick_vh’s picture

StatusFileSize
new1.53 KB

Discovered that the alias was used and in some cases the field. We should never use the alias, since this can be different compared to the field that is used.
The reversing of the params is also very crucial in this patch (thx dixon_), because the facet will go bezerk otherwise

nick_vh’s picture

StatusFileSize
new92.09 KB

obligatory picture to prove that everything is still working.
Renamed ds_created in the url to postdate, so the alias is still working

nick_vh’s picture

#1642140-8: Make the search query also escape the slash and move away from menu_tail to just 1 argument Swentel confirms that this patch is required to make it all work. Any change of getting this tested with Search API? If someone can confirm that this patch does not hurt Search API, it's RTBC.

nick_vh’s picture

Status: Needs review » Needs work

So we only have the reverse again. It looks like this is breaking the breadcrumb order. The alias issue was committed #1650522: Alias wrongly used in certain context

nick_vh’s picture

StatusFileSize
new90.64 KB

Confirmation that breadcrumbs are ordered in wrong direction with this array_reverse. But without it, the facet ordering in the blocks are not ok.
Search | Smartphone compare-3.jpg

nick_vh’s picture

Without patch :

Search | Smartphone compare-4.jpg

With patch :

Search | Smartphone compare-5.jpg

dasjo’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

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