Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Facet set to OR gives wrong counter for the active item(s)
See screenshot.
Problem is in function build() in file SearchApiString.php
i did a quick fix bij changing line 105, but that is a bad solution.
if ($query_operator === 'OR' && $count == 0) {
The problem is that $key is not correct all the time.
Comment | File | Size | Author |
---|---|---|---|
#7 | test-only.patch | 2.42 KB | borisson_ |
#5 | active_facet_displays_wrong_count-2671938-5.patch | 3.48 KB | jeroen_drenth |
Comments
Comment #2
jeroen_drenth CreditAttribution: jeroen_drenth as a volunteer commentedI believe this patch will fix it.
Comment #3
jeroen_drenth CreditAttribution: jeroen_drenth as a volunteer commentedComment #4
borisson_Can we have a red test for this before we commit this?
Comment #5
jeroen_drenth CreditAttribution: jeroen_drenth as a volunteer commentedThe issue occurred because the order of the facet results were in a different order to the unfiltered result. The test in this patch goes red in before and green after the test. I'm not very good with unit testing, so please tell me what you think.
Comment #6
jeroen_drenth CreditAttribution: jeroen_drenth as a volunteer commentedComment #7
borisson_Let's see if a patch with just the test is red. It looks great though so if that's happening, I think we can get this in.
Comment #10
borisson_Awesome, that's exactly as expected.
Comment #11
jeroen_drenth CreditAttribution: jeroen_drenth as a volunteer commentedNice! Thanks for your quick reply.
Comment #13
borisson_I fixed a small code style thing and committed the patch. Thank you very much for the patch and the test.