based on discussion http://drupal.org/node/1374040
the problem is that user's expected behaviaour after desactivating parent's facet and activating it again in some time -to see child's choice to be clear -it's not so due to leaving child's query in URL after that desactivating
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | facetapi-1387322-5.patch | 1006 bytes | cpliakas |
| #2 | facetapi-1387322-remove-dependent-facet-query-element.patch | 2.38 KB | ygerasimov |
Comments
Comment #1
cpliakas commentedThis is definitely a usability issue the more I think about it, so marking as a bug report. For me personally it is a low priority given other tasks at hand, however I would love to get some contributions on this to help move it along. I am also open to fixing this post 1.0 since it wouldn't change the API or be a major shift in functionality.
Comment #2
ygerasimov commentedHere is initial patch to fix this issue.
The idea is that we also execute all dependency plugins during building link in FacetapiUrlProcessorStandard::getQueryString and check if facet will be hidden, then remove its query component.
This fixes both bundle and parent dependency plugins.
Comment #3
SergeyR commentedmade crush test for this patch :combinations of different plugins in chains etc.
still no bugs
everything is perfect
Comment #4
cpliakas commentedThe patch works, and the code is very clean. However it does realize my fears with this issue that the dependency plugins have to be executed for every facet item on the page. So if we have 100 facets and 3 dependencies, thats 300 extra FacetapiDependency::execute() method calls that are invoked on a search page. I definitely don't want to do that if we can help it.
Comment #5
cpliakas commentedHere is an alternate approach. It is not as complete of a solution as ygerasimov's, however it does end up preventing the usability issue. The problem with this approach is that the value exists in the query string when the parent item is deactivated, however the new links don't contain the value in the query string. So in other words when you re-activate the parent, the child items aren't re-activated.
Comment #6
ygerasimov commentedVery elegant solution! (I agree that my approach is a bit too heavy). I think it should be suitable for everyone's needs. Marking this issue as RTBC.
Comment #7
cpliakas commentedThanks for testing! It will forever annoy me that the item exists in the query string, but so be it.
Comment #8
cpliakas commentedCommitted to the 7.x branches at http://drupalcode.org/project/facetapi.git/commit/91ee500 and 6.x-3.x branch at http://drupalcode.org/project/facetapi.git/commit/5a07bd8.