The _date_facets_api_facet_create_label() function simply copies the keys to the values and does not do any actual mapping. This causes the facetapi's current_search block to display "past_hour", "past_24_hours", etc... In addition, in date_facets_associate_widget(), the $facet_info array syntax is incorrect so the mapping callback is never called.

Comments

criznach’s picture

Status: Active » Needs review
StatusFileSize
new1.13 KB

Patch attached. Implemented key-value mapping in _date_facets_api_facet_create_label and fixed mapping callback.

eugene.ilyin’s picture

Status: Needs review » Postponed (maintainer needs more info)

Hello.

Sorry for delay - summer :)

I tryed to reproduce your problem, but seems now all works fine.

Without filtering:

filter - http://i.imgur.com/Fb4RlqR.png
values of facet - http://i.imgur.com/4FT7cwd.png

With filtering:

filter - http://i.imgur.com/OWFVKe9.png
values of facet - http://i.imgur.com/y8d1aIJ.png

As you can see, values of filter displayed without underscores and #markup also stored value without underscores.

Maybe I do something wrong, please give me more info.

criznach’s picture

StatusFileSize
new245.92 KB
new227.11 KB

It's happening in the current search block provided by facetapi, and in the breadcrumb, but not in the filters that are available to apply, which your screen shots seem to show.

I just tried it with both apachesolr + facetapi, and core search + search_facetapi, and they're both still showing underscores. I grabbed the latest dev release of facetapi and date_facets. Let me know if there's anything else you need to know about my config. I can send a database dump and drush makefile from my test install if that would help.

eugene.ilyin’s picture

Status: Postponed (maintainer needs more info) » Fixed

Yes, you right.
Committed.

Thank you for your help!

Status: Fixed » Closed (fixed)

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

joseph.olstad’s picture

Issue summary: View changes
StatusFileSize
new620 bytes

refactor patch#1 for todays dev build revision f2951cab4a993fd32c2c2fb0fb061abd889ae236

joseph.olstad’s picture

Status: Closed (fixed) » Patch (to be ported)
Related issues: +#2232957: WetKit Search Updates (v1.4)

See comment #6

We were using this patch on beta-2 build which is over 8 months old and now due to warnings being thrown from the beta 2 build we decided to run the dev build commit f2951ca and patch it with

*EDIT*
projects[date_facets][patch][2016601] = http://drupal.org/files/issues/date_facets-date-facets-displayed-as-keys...
AND
projects[date_facets][patch][2280631] = http://drupal.org/files/issues/date_facets_beta2_dev_Missing_argument_2_...

Follow up tomorrow on this.

joseph.olstad’s picture

eugene.ilyin’s picture

@joseph.olstad

Sorry, I'm confused. Which problems will appears in current version and how I can reproduce them?

eugene.ilyin’s picture

Status: Patch (to be ported) » Needs review
eugene.ilyin’s picture

Status: Needs review » Needs work

  • eugene.ilyin committed 9037608 on 7.x-1.x
    Issue #2016601 by criznach, joseph.olstad: Date facets are displayed as...
eugene.ilyin’s picture

Status: Needs work » Fixed

I updated search_api and search_api_solr and got this error.

But unfortunately, your patches are not helped. I found that reason of error in module search_api_facetapi in function search_api_facetapi_map_date(). I'm not sure that it's error of module search_api_facetapi.

I think that easiest way make little hack in module date_facets to avoid this problem.

So, it's solved. Thanks to all who helped me.

Status: Fixed » Closed (fixed)

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