Hi!
I have a trouble with integer facets.
How to reproduce it:
1. Select taxonomy facet (in my case, facet URL will be: manufacturer/team-1104)
2. Select integer facet: manufacturer/team-1104/warranty/56
3. Try to select taxonomy facet: manufacturer/team-1104/warranty/160-gb-56/ram-size/4-gb-52
As you can see warranty/56 were switched to warranty/160-gb-56
When i explored, what does it mean "160-gb-56", i found that taxonomy term with tid=56 has alias "160-gb-56"
So, it like that value of integer field interpeted as taxonomy term id, and replaced with it's alias.
Comments
Comment #1
dasjohi, that's weird.
i don't have time to verify right now, but if you want to try to debug this, take a look at how
facetapi_pretty_paths_coder_callbackis called and whichfacetapi pretty paths codergets selected in the process.you might want to use live debugging (xdebug) or output variables using dpm() of devel module + ddebug_backtrace() to see how the function gets called.
Comment #2
sun-fire commentedThank for your advice where to start digging. I've dsm
$argsarray in functionfacetapi_pretty_paths_coder_callbackjust afterand have found that the
$args[1]['segment']['facet']and$args[1]['facet']is the current first active facet (not the related to current segment). Maybe, it is the reason for the issue (when the first active facet is not taxonomy - all work fine and if it is taxonomy - we have the issue). Where to look further? Thanks!Comment #3
dasjook, now we need to go up the chain: as stated
ddebug_backtrace()will give you of the calling functions, i recommend using it to figure which functions to inspect. you should end up going toencodePathSegment()and furtherconstructPath()to examine the structure of$segmentsin order to check how the whole segments structure with the facets looks like.then have a look at
getPathSegment()as here the segments are generated. it is used primarily infetchParams()where all the initial magic happens. there is actually a code comment that indicates that i experienced some weird behavior with using references:i think this is the place where trouble could be caused
Comment #4
dasjoyou could try doing
$my_facet = clone $facet;instead of$my_facet = $facet;infetchParams()but that would be a hack because we don't really want to copy the object but just the reference...Comment #5
sun-fire commentedI found that when change
'facet' => &$facetto'facet' => $facetin functiongetPathSegment(url_processor_pretty_paths.inc), all work fine.Comment #6
dasjoglad to hear, could you provide a patch so we can get this fix in?
Comment #7
sun-fire commentedThis is a patch for #5
dasjo, thanks for your advices
Comment #8
dasjothx, looking forward to get this in
Comment #9
dasjoi was able to reproduce the problem. it actually applied for any combination of mixed facet types.
committed, thanks!
Comment #10
dasjo