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

Comments

cpliakas’s picture

Title: dependency plugins -remove child's query string after disactivating parent facet » Remove dependent facet items from the query string when the facet item they depend on is deactivated
Category: feature » bug
Priority: Normal » Minor

This 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.

ygerasimov’s picture

Status: Active » Needs review
StatusFileSize
new2.38 KB

Here 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.

SergeyR’s picture

made crush test for this patch :combinations of different plugins in chains etc.
still no bugs
everything is perfect

cpliakas’s picture

Status: Needs review » Needs work

The 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.

cpliakas’s picture

Status: Needs work » Needs review
StatusFileSize
new1006 bytes

Here 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.

ygerasimov’s picture

Status: Needs review » Reviewed & tested by the community

Very 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.

cpliakas’s picture

Thanks for testing! It will forever annoy me that the item exists in the query string, but so be it.

cpliakas’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.