Hi,

While building a multilingual webshop for a client of ours, I noticed a small bug in one of the facet-removal links, in the current search block.

In facetapi/contrib/current_search/plugins/current_search/item_active.inc on line 37 to line 45 there is the following codeblock:

      $variables = array(
        'text' => theme('current_search_keys', array('keys' => $keys, 'adapter' => $adapter)),
        'path' => request_path(),
        'options' => array(
          'attributes' => $attributes,
          'html' => TRUE,
          'query' => $facets,
        ),
      );

Notice the 'path' => request_path(), piece:

On a multilingual website with path prefixes, request_path() would generate paths of the type ($_SERVER['REQUEST_URI']):

en/home
en/catalog
en/contact

These paths would then be used in l() / theme_link functions, which causes a double language prefix in the URL:

en/en/home
en/en/catalog
..

To fix this issue, I have replaced the function call "request_path()" to "current_path()", which only returns the $_GET['q'] query variable, and thus generating correct URLs.

I hope to have helped someone by posting back this "issue".

Comments

cpliakas’s picture

Issue summary: View changes
Status: Needs review » Postponed (maintainer needs more info)

Thanks for posting!

The logic seems sound, however it looks like as of Facet API 1.3 the calls to request_path() were removed. However, more logic was pushed to the implementing search modules so I am curious is the same bug still exists, just coming from another location.

Marking as "maintainer needs more info" pending confirmation that the bug still exists.

Thanks for posting!
Chris