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.
Hi,
Problem is I cant sort table fields by clicking on header tag. If there is a request to sort fields, labels dont even move.
How to create this issue just follow basic search api setup, add content (title) and activate sortable on header title. This only accursed when I use indexed fields.
Click and u might see nothing has moved at all.
Any Idea for Quick fix? Thinking of wrong index from my side??
Greetings
Comment | File | Size | Author |
---|---|---|---|
#4 | 2816979-4--fix_views_click_sort.patch | 5.07 KB | drunken monkey |
|
Comments
Comment #2
drunken monkeyYou're right, it seems we forgot to implement this. Patch attached, please test!
PS: It seems you (like many others – it's really easy to misinterpret) are confused by the "Issue tags" field. As the guidelines state, they aren't meant for free text tags related to the issue, but only for specific categorization purposes, usually by module maintainers.
So, if you aren't sure your current usage is correct, please just leave the field empty.
Comment #3
borisson_I haven't done any manual testing but it looks good. Do you think we need to add a test or would this lead to too much duplication of views tests?
Comment #4
drunken monkeyI already did manual testing, but automatic tests are of course even better. Wasn't too hard, either.
Comment #5
borisson_I noticed you used ++$i again, and I'd do it the other way around but that doesn't matter. We've had that discussion before. Test looks good and it's green, great job!
Comment #6
drunken monkeyYeah, let's not get into that. ;)
Thanks for reviewing!
Committed.
Comment #8
borisson_Changing status.
Comment #9
mkalkbrennerThe new tests fail on Solr. The difference is in the "value" for an empty field.
I'm not sure if this is
At the moment Solr "ignores" content that has no category assigned in the tests and always puts '[EMPTY]' on the bottom while the other values are sorted correctly ascending or descending.
I remember a similar "feature request" for apachesolr 7.x. I guess from Solr's perspective it is a feature.
Should we open new issues to deal with that difference? Should we at least isolate the new test that it could be overwritten in the Solr module?
Any ideas?
Comment #10
drunken monkeyYes, the current tests hard-code the assumption that
NULL
will count as the "lowest" possible value when sorting. This is not really defined anywhere in the Search API and just an assumption. (One that we're even lucky is true for all three DBMSs we test with, I guess. I'm not sure this is defined in the SQL standards – and even if it is, we know that doesn't mean all that much.)Anyways, for fixing this in Solr, I think several options are viable:
NULL
values (though I guess we already test for those in the backend kernel tests)).Maybe we should open a new issue for this in any case, though. Feel free to ping me on IRC for further discussion.
Comment #11
mkalkbrennerAfter a discussion in IRC we modified the sorting behavior of our Solr backend to be compatible to the DB backend. BTW this behavior is Lucene's default behavior as well :-)