Closed (fixed)
Project:
Facet API
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Jan 2013 at 12:04 UTC
Updated:
10 Jul 2016 at 20:08 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
derhasi commentedAnd there is the patch.
Comment #2
derhasi commentedThe patch is applied relative to current 7.x-1.x-dev.
Comment #3
cpliakas commentedThanks for the patch! This makes sense to me, will test it out soon.
Comment #4
duozerskI have recently created another issue with a patch for this bug - #2206649: processActiveItems() / addActiveFilters() compatibility
I have opted to fix it another way - will close it now as duplicate and post another patch here.
Thanks
AndyB
Comment #5
duozerskHere is a patch from #2206649: processActiveItems() / addActiveFilters() compatibility
Comment #6
duozerskHere as another version of the patch in #5 - without using any additional calls to rawurldecode/rawurlencode functions.
Thanks
AndyB
Comment #7
duozerskComment #8
duozerskComment #9
cpliakas commentedHi duozersk.
I am not seeing the issue mentioned in the OP. Could you provide steps to reproduce on a clean install of Drupal w/ implementing search modules in order to highlight the bug?
Thanks,
Chris
Comment #10
duozerskChris,
I have made a demo on http://andrewberezovsky.ru/demo/demotest/
It uses the Facet API, Search API, Search API DB and Facet API Bonus modules. There is a dependency set on the facets (Brand and Model are 2 separate taxonomy vocabularies) - show Model facet only after selecting any value in the Brand facet (and remove the Model facet value after removing the Brand facet value).
The bug is that if after selecting the Brand and Model you remove the Brand facet value - then the Model is not removed from the Current search block and the breadcrumbs.
The reason for this bug is explained in the referenced issue - #2206649: processActiveItems() / addActiveFilters() compatibility
"The processActiveItems() uses the raw, not urldecoded key to set the $this->activeItems['filter'][__KEY__] while addActiveFilters() tries to remove the facet that didn't meet the dependencies using the 'field alias' key which is urldecoded."
Hope it helps.
AndyB
Comment #11
cpliakas commentedHi duozersk .
Thanks for taking the time to set up the demo. The bug is crystal clear to me now, and your description has helped me to replicate it locally as well. Marking your patch in #6 as RTBC as I can confirm that it fixes the issue.
Thanks for the contribution and efforts to help me understand the bug,
Chris
Comment #14
cpliakas commentedComment #15
duozerskGreat!
Thank you for coming back to this issue, really appreciate your efforts on Facet API.
Comment #17
adam clarey commentedI've attached a patch to prevent php notices occurring when the $parts array only contains a single item by declaring $filter within the if statement.
Comment #18
drummSee #2378693: Notice: Undefined offset: 1 in FacetapiAdapter->processActiveItems() line 312 for fixing the notice.