Closed (fixed)
Project:
Facets
Version:
8.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
22 Apr 2016 at 14:18 UTC
Updated:
27 May 2016 at 08:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
strykaizerNeeds test
Comment #3
borisson_I'll have a look at this, to try to write a test.
Comment #4
strykaizerComment #5
borisson_I think this test proves what's wrong, so getting this to pass should be a good start.
Comment #8
borisson_The test failed earlier on
If I change getEnabledFacets in the DefaultFacetManager so it returns this in reverse order, that line passes but it creates a new failure, on line 543 of the test:
This means that the order in which the facets are returned from
loadMultipleis the order in which the facets are processed and the count is being added.I removed that code from the patch, but added a more restrictive assertion in the test. Not sure how we should resolve this, but at least we have an idea to where this comes from.
Comment #11
borisson_Rerolled this, still no solution though.
Comment #14
borisson_Back to the one expected error. I have no idea how to even start on this.
Comment #17
dasjoI haven't had time to look at this, but from looking at the code, I'd start debugging at
FacetsQuery::execute()at line$this->condition($this->conditions);Comment #18
claudiu.cristeaThis, for me, fixes the problem. However, this needs a deep review because I'm not sure we have the same bug.
Comment #21
borisson_The test seems to disagree with your solution, and I can't see how that'd make any difference either.
Comment #22
marthinal commentedI'm trying to understand why the result is always the same in the case of some facets. Well, if we use the OR query operator by default... then we will build the unfiltered options:
Maybe I'm missing something... anyway let's try with this patch
Comment #23
strykaizerFollowing patch should fix the issue for search api datasources. We should not calculate count ourself but rather delegate this to the datasource, as certain backends (e.g. solr) provide this automaticly.
Other data sources then search api should prolly be looked after to provide the correct count too. An example for sql-based sources can be found in search_api_db in Database.php::getFacets()
This patch includes test from #14
Comment #24
strykaizerComment #27
claudiu.cristeaThis can be compacted to only 3 lines:
Comment #28
borisson_Attached interdiff fixes #27 and fixes the unit test that broke in #23. @StryKaizer is fixing the integration test meanwhile, so not uploading a full patch.
Comment #29
strykaizerPatch with integrationfix and interdiff from #28
Comment #30
claudiu.cristeaNits. I will test the patch in the evening.
Space around if() parenthesis. See https://www.drupal.org/coding-standards#controlstruct
Remove this un-needed line. Just after:
Comment #31
borisson_Fixes nits from #30.
Comment #32
claudiu.cristeaIs working as expected. Thank you.
Comment #33
borisson_Committed, thanks for the reviews and the patches everyone.