I've been chasing this issue through a number of projects and over a number of months now. The issue comes down to

  1. Search API results in a View in a Panel (the results).
  2. Facets on a non-search Panel.

These issues seem to address the same or similar issues but don't seem to suit this mixed case.
https://drupal.org/node/1827272 // base_path
https://drupal.org/node/1863866 // base_path again
https://drupal.org/node/1861786 // base_path from prettypaths point of view

  1. I can get Facets working well in Panels.
  2. I can get Facets displaying in a non-search Panel using Views/Panels Context.
  3. I couldn't get the path for the Facets to point to anything other than 1) the current (non-search) Panel or 2) the SearchAPI View page. Neither of these are correct (it needs to be the Views enabled Panel).

eg:

  1. Views (SearchAPI) at 'search'.
  2. Panels page (with View and Facets) at 'query'.
  3. Non search Panels page (with Views Context and Facets) at 'node/1000'.

Everything works well except the paths that FacetAPI generates are pointing to node/1000 or (with the patch from here) to 'search' (the original View page). The patch sets search_api_base_path.

Looking for options I discovered the Views settings for Panels which allows Panels to override the URL of the View.
View > Displays > Content pane
Pane settings > Allow settings > Path override

And in Panels
Panel > Settings > Override path

This looked promising but didn't work (no change). Looking through the code I couldn't see anywhere that linked up Path override with base_path. The following patch achieves that, passing the overridden path all the way through to the Facet generation.

This seems to be a fairly common case. Am I missing something more straight-forward?

Comments

queenvictoria’s picture

Please review the method and patch. Also attached are UI images for reference.

queenvictoria’s picture

Assigned: queenvictoria » Unassigned
Status: Active » Needs review
queenvictoria’s picture

StatusFileSize
new1.17 KB

Updated to support facetapi_pretty_paths.

drunken monkey’s picture

StatusFileSize
new781 bytes

Hm, interesting. Sadly, I don't really know anything about Panels, and it's the first I've heard about overridden paths, so I'm not really sure what will be the consequences of this patch. It's good if it fixes your problem, but it's quite possible it'll break someone else's setup. And I don't really know how we could tell.
Then again, the change seems reasonable – if the URL is overridden, we should probably use that as the base path. It makes sense. So, I guess unless any negative reviews come in, I'll commit this and we'll just have to see whether it breaks anything for anyone else.

In any case, comment lines shouldn't exceed 80 characters. At least something I can contribute to this patch. ;)

drunken monkey’s picture

Category: feature » bug
Status: Needs review » Fixed

Committed.
Thanks again!

Status: Fixed » Closed (fixed)

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