Hello, I've used apachesolr_location module and faced the problem, that country filter is not working with "country" as facet name in URLs.
When I looked into the module, I saw that there's no "name" attribute in parameters.

$facets['city'] = array(
    'label' => t('City'),
    'name' => 'city', //should be here
    'description' => t('Filter by city.'),
    'field' => 'ss_locs_city',
    'field alias' => 'country' //would be useful to have it here
    'field api bundles' => array('node'),
    'facet mincount allowed' => TRUE,
    'dependency plugins' => array('bundle', 'role'),
  );

This leads to the situation, that location filters not working with country:be, but it works with ss_locs_country:be in the URLs. In fact, I had to implement hook_facetapi_facet_info_alter() to fix this and add "field alias" attribute. This worked in my case, but I'd like to suggest general solution to this -
the name attribute, actually, is the only _really_ required in facet definition, so I suggest to add it as well as "field alias" attribute, so everything will work as expected.

Please find attached patch for this purpose below.

--
Kind regards, S

Comments

nick_vh’s picture

Status: Active » Needs work

patch is wrongly generated. Please reroll

32i’s picture

re-rolling patch.

nick_vh’s picture

Status: Needs work » Fixed

Committed, thanks!

32i’s picture

aaand re-rolled again - I've fixed typos.

32i’s picture

created patch for latest build.

nick_vh’s picture

Committed! Thanks for following up on this issue

Status: Fixed » Closed (fixed)

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