Coming from #1861786: Fix base path issues I decided to make the base path logic of facet api pretty paths pluggable.

By default, there are two base path providers available:

  1. Default base path provider - Calculates the base path by subtracting facet path segments from the current url. This is the behaviour we had so far.
  2. Adapter base path provider - Relies on the FacetapiAdapter::getSearchPath() method to generate the base path. This one is likely overridden by SearchApiFacetapiAdapter::getSearchPath() or ApacheSolrFacetapiAdapter::getSearchPath(). This is what the patch from #1861786-36: Fix base path issues was about.
CommentFileSizeAuthor
facetapi_pretty_path_base_path_providers.png150.66 KBdasjo
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

  • dasjo authored f8a3b35 on 7.x-1.x
    Issue #2413319 by dasjo: Add base path provider plugins
    
dasjo’s picture

Issue summary: View changes
torgosPizza’s picture

This change fixed my issues using Apachesolr with FacetAPI, and the new FacetAPI Pretty Paths 7.x-1.x-dev. The links to "clear" a facet as being selected "(-)" now actually work to clear the selection. Many thanks for this new feature!

dasjo’s picture

glad to hear! so you are using the "Adapter base path provider"?

i wonder if we should make it the default one if the apachesolr module is being used.#

also it would be great to get feedback from search_api folks on which base base providers work for them.

torgosPizza’s picture

I actually don't get any options in the configuration settings for any base path adapters, so my guess is it's the default (none?). I moved away from Search API so I can't speak to that unfortunately.

dasjo’s picture

hm thats interesting, with the latest dev and caches cleared you should have the configuration settings available.

torgosPizza’s picture

Ah, yes you're correct. I was looking at the wrong environment.

Selecting the Adapter base path provider results in the same incorrect "linked" facet-clearing link as before; switching back to the Default allows facets to be deselected once again.

dasjo’s picture

that's weird. the default provider is the functionality that we had before and the adapter provider implements the apachesolr fix proposed in #1861786-36: Fix base path issues

torgosPizza’s picture

Yes, that might be why it's working for me now. It had been a while since I had updated. Sorry for any confusion on my part.

heddn’s picture

The base path provider isn't called for a Views RSS feed that exposes my search api db backend results. I can't tell if it is supposed to. The regular search api view invokes the provider, but regular search view is exposed in a panels page. Additionally, I'm using pretty path.

This works if I manually type in the URL:
newsroom/news-releases/search/rss/year/2015.

I can mess with writing a views rss style plugin, but I was hoping to do this natively in facet api land.

dasjo’s picture

Status: Active » Fixed

Could you open a separate issue to discuss that please?

Setting as fixed because the plugins have already been implemented and committed.

Status: Fixed » Closed (fixed)

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

heddn’s picture

I ended up having to do this in a views rss style plugin.