Closed (fixed)
Project:
Facet API Pretty Paths
Version:
7.x-1.0-alpha6
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
19 Apr 2012 at 13:04 UTC
Updated:
17 Jun 2014 at 12:02 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dasjohi e-anima,
what kind of search are we looking at? could you provide an export of the view?
this looks like if the base path of this search was taxonomy/term/2, are you overriding taxonomy term pages using page manager?
Comment #2
marcoka commentednope, i use a view with search api.
and well i override taxonomy/term/% so when i click a tagging link it triggers a search, thats a view taxonomy/term/%
i am using pathauto and all taxonomys/nodes have aliases
Comment #3
marcoka commentedOk as discussed @irc, clicked first facet
outputs
clicking a second one goes to
http://dev.text.com/taxonomy/term/%25/field_beschaedigungsgrad/schwach-3...
not found
Comment #4
dasjoso the problem is that $this->adapter->getSearchPath maps to the "taxonomy/term" search instead of the "texturen" one.
this needs further debugging of what is happening and why getSearchPath does return the wrong base path when you have pretty paths enabled.
Comment #5
sslam commentedI have the same problem on my site.
Subscribing
Comment #6
dasjoi would like to encourage you to debug the problem / help with a solution rather than bumping up the issue priority
Comment #7
uditmahajan commentedI am facing same problem.
The module works with one facet option (And Operator) but with multiple facets it shows wrong url.
Let me know how I can help in debugging the problem.
for me facets are normal fields for example for clothes brand is one of the facets. so selected two brands for ex:
/brand/ck/brand/tommy gives error. Whereas selecting only one facet works absolutely perfect.
Comment #8
dagomar commentedI had the same, or a similar problem. It turned out I had to change the "Pretty path alias" at the bottom of the "Configure facet display" option page. It was shown as:
when I changed that for each facet to something like "My-field" it worked.
I think the problem was with the : character not being properly encoded or something... Note that the problem also occurs with spaces and other non-url friendly characters.
Comment #9
dasjoi have just fixed the problem, dagomar stated in #8.
leaving the issue open to fix its primary cause. both problems shouldn't be directly related, though and i have multiple facets working on several sites using pretty paths.
Comment #10
guillaumev commentedI'm also having the same issue here, and I'm using search_api_page to display my search results (no view), with facetapi_pretty_paths alpha4...
Comment #11
guillaumev commentedHere is a patch that should fix the issue (at least it fixes it for me).
Comment #12
dasjohi guillaumev,
thanks for working on this! i'm not convinced that this is a generic enough approach that i can commit right away.
i can believe that the current implementation of setting the search base path by using $menu_item['href'] might not always work, but simply adding $args[0] won't solve that problem, in my opinion. we should find another way to ensure that the base path is set correctly. think for example of a search base path like "search/cars", such wouldn't be covered by the args[0] approach.
Comment #13
giorgio79 commentedI am getting this as well, but in my case it is a plain view with a custom path.
The problem is that the module chops off the subfolders, so instead of
mysite.com/mypath/facet1/facet2
it goes to
mysite.com/facet1/facet2
Any tips for debugging?
Comment #14
dasjogiorgio79,
can you provide an export of the view that's not working?
does it work for other views you configured and if so, how do they differ from the corrupted one?
for debugging purposes, have a look at
plugins/facetapi/url_processor_pretty_paths.inc-
fetchParamswhere the base path is interpreted:$_GET['q'] = $menu_item['href'];-
getFacetPathwhere the base path gets prepared:$base = $this->adapter->getSearchPath();Comment #15
guillaumev commentedHi dasjo > args[0] just adds the string that's being searched for to the URL, so I double checked by changing the path of my search page from search to search/test and it worked, because $menu_item['href'] contains search/test and $search contains the string that's being searched for, resulting in the URL being correct...
giorgio79 > did you try applying the patch in #11 ?
Comment #16
guillaumev commentedNew patch which works with the latest version...
Comment #17
giorgio79 commentedre @15 sorry, not yet. I uninstalled the module because I had to move on to other tasks.
Comment #18
giorgio79 commentedHello,
I was just about to install this, but with the latest dev seems to be working for me without this patch. Please check.
Comment #19
dasjoyeah, please confirm if this issue persists with the latest version of the facet api pretty paths module.
i'm tempted to close this soon and have related discussions in separate issues that are easier to grasp and tackle
Comment #20
chirhotec commentedI'm running 7.x-1.0-alpha6 and still having this problem, as far as I understand it.
Just to make sure, here's what I'm trying to do:
Installed:
What I've done:
Results:
***Additional problems
I've noticed that the first search term isn't showing up in the list of filters (current search block). In the results example above (1) parents doesn't show up, (2) handout does show up, (3) parents doesn't show up, but handout does. While it seems related to this overall problem, I'm not sure its related to this module.
Has anyone else seen this second problem? Where would be a better place to post about it?
Default Search:
Taxonomy Override
Comment #21
dasjotrying to find an appropriate title for this issue and turn it into a support request rather than a bug report.
i would like to know if you can implement all the desired functionality without pretty paths being enabled?
ad #22
i guess, the problem lies within the Pathauto approach, can you identify any difference in the behavior if you remove the path aliases and hit the urls directly?
Comment #22
chirhotec commentedIf I disable Pretty Paths, the resulting facet links form correctly, without replacing the path alias with the default taxonomy path. (for "parents" + "handouts": /search/audience/parents-3?f[0]=field_tags%3A10).
There is still the problem of the initial term not showing in the list of facets, but that is expected at this point, since the url no longer follows the pattern Facet API is using. I tried switching the aliases to match the query string (/search?f[0]=field_audience%3A1) but that doesn't work because all the generated links get encoded (ie, /search%3Ff%5B0%5D%3Dfield_audience%253A1). Which is apparently an issue with Drupal Core (issue: http://drupal.org/node/118072)
With Pretty Paths enabled, directly hitting the desired URL works, and both facets show up in the current search block too. Additionally, the correct links are generated for applying additional filters. I guess at that point its not recognizing the first part of the url lines up with the default taxonomy view.
Comment #23
dasjoso my understanding is that you don't need facetapi pretty paths to behave differently but you need a way to rewrite your taxonomy term links to the corresponding search path.
Comment #24
chirhotec commentedHonestly, I don't know enough about drupal under the hood to know where the issue is. I am already using pathauto to generate taxonomy term links that correspond to the Pretty Path. But for some reason, somewhere in the system, when it grabs the url its grabbing drupal's system url, not what was actually typed in (the alias).
In trying to work around this issue, I noticed similar problem in Views. I created two Contextual Filters of type "Global: Null", to read the first and second term of my url. When I navigated to "/audience/parents" (an alias for "taxonomy/term/3"). The result was that the filters read in "taxonomy" and "term" instead of "audience" and "parents", respectively.
So, I'm wondering, if your using a function to grab the url for processing, if there is a way to grab whatever the alias is instead, or maybe whatever was actually supplied in terms of the url within the browser.
In the end, my requirements changed slightly, and I was able to get the new functionality implemented by not using Pretty Paths, so its a non-issue for me at this point.
Comment #25
Robin Millette commentedIf #23 is correct, have a look at these two issues:
#1635106: Views Integration: "Link this field as a facet" in addition to the default "link this field to its entity"
#1626468: Function call for outputting a facet link?
Comment #26
khiminrm commentedThe patch in #16 has solved my similar issue with Extended search pages.
Comment #27
khiminrm commentedAfter applying the patch in #16 I have a Notice:
Undefined offset: 0 в FacetapiUrlProcessorPrettyPaths->fetchParams() (line 56 in /home/www/mysite/sites/all/modules/facetapi_pretty_paths/plugins/facetapi/url_processor_pretty_paths.inc)I've changed $search = $args[0]; with
if (!empty($args[0]))$search = $args[0];and the notice has disappeared.Comment #28
khiminrm commentedThe patch in #16 conflicts with http://drupal.org/node/1511144#comment-6326486.
Found temporary solution:
replaced $_GET['q'] = $item['href'].'/'.$search;withComment #29
khiminrm commentedfor #28. I use Search pages with path 'search/site' for my search results and View with path 'catalog/%' for my catalog of products
Comment #30
dasjoin order to clean up the issue queue and as of #19 i'm setting this to fixed.
please open related issues separately with a back-reference to this one.
Comment #32
kamranzafar commentedHi Guys,
Your efforts are great.
I have site where I'm showing facets on taxonomy term page.
http://www.mysite.com/category/country/germany
Now when I select the facet link it make url like this
http://www.mysite.com/taxonomy/term/[tid]/make/chiron
Where I want this to be like
http://www.mysite.com/category/country/germany/make/chiron
Now issue is Drupal is not decoding "category/country/germany" as url alias to show taxonomy page then apply the facet, it take whole url "category/country/germany/make/chiron" which is not a page and shows me page not found.
How can I get this done.
Regards,
Kamran Zafar
http://www.cognitiveaxis.com/