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.
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:
- 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.
- 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.
Comment | File | Size | Author |
---|---|---|---|
facetapi_pretty_path_base_path_providers.png | 150.66 KB | dasjo |
Comments
Comment #2
dasjoComment #3
torgosPizzaThis 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!
Comment #4
dasjoglad 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.
Comment #5
torgosPizzaI 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.
Comment #6
dasjohm thats interesting, with the latest dev and caches cleared you should have the configuration settings available.
Comment #7
torgosPizzaAh, 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.
Comment #8
dasjothat'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
Comment #9
torgosPizzaYes, 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.
Comment #10
heddnThe 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.
Comment #11
dasjoCould you open a separate issue to discuss that please?
Setting as fixed because the plugins have already been implemented and committed.
Comment #13
heddnI ended up having to do this in a views rss style plugin.