Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
relying on $_GET['q'] for determining base paths is quite hacky.
for example in the Facet API Pretty Paths module needs to mock a base path in order to work properly.
we should find other ways to determine base paths
Comment | File | Size | Author |
---|---|---|---|
#1 | 1777710_remove_get_q_for_base_paths.patch | 592 bytes | dasjo |
Comments
Comment #1
dasjoi have attached a patch that fixes the problem.
see the according facetapi pretty paths issue that depends on this change: #1777714: Don't modify the query path
note, that the patch doesn't remove all usages of $_GET['q'] but just the one that i found causing errors
Comment #2
stockliasteroid CreditAttribution: stockliasteroid commentedI tested this with a solr backend and it seems to work fine... This plus the associated facetapi_pretty_paths patch is a lifesaver, as the associated problems with views pagers are pretty unpleasant to deal with.
Comment #3
drunken monkeySeems to work great, thanks!
Committed.
Comment #5
osopolarThe fix is using menu_get_item() to determine the current page url. This only works if the current page has a menu link. In my case I use page manager to show different search types:
example:
search
andsearch/nodes
... for a search on node index (default)search/files
... for a search on file indexI set the path in page manager to
search/!type
, where the type-Argument is optional. The resulting menu_link path issearch
. On top of this I created two different panel variants using the type argument as criteria to define which search page should be shown (node or file search). The path of menu_get_item() will always be just search, the facets always will link to /search - although the user might be on the search/file page.My workaround: I created two pages instead of two variants to get it work with menu_get_item().
Comment #6
drunken monkeySee #1827272: Facet path can be incorrectly returned for further discussion.
And you shouldn't post into closed issues without re-opening them – this reduces your comment's chances of being seen to practically 0.