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.
Problem/Motivation
When creating an Apachesolr view with any type of sort, it appears the sorts are overridden when a module provides a sorting option by setting "$query->setAvailableSort" in "hook_apachesolr_query_prepare".
My example is using apachsolr_views in conjunction with weight module, where all sorting within views breaks.
Proposed resolution
Using the patch provided by the related issue solves this problem to a degree, but may need further investigation/testing.
Comment | File | Size | Author |
---|---|---|---|
#4 | set_available_sort_problem-2628236-4.patch | 502 bytes | MiroslavBanov |
Comments
Comment #2
j1mb0b CreditAttribution: j1mb0b as a volunteer commentedComment #3
j1mb0b CreditAttribution: j1mb0b as a volunteer commentedComment #4
MiroslavBanov CreditAttribution: MiroslavBanov at FFW commentedDoes this patch work for your problem? It aims to completely prevent query alter hooks from changing the sort.
Comment #5
j1mb0b CreditAttribution: j1mb0b as a volunteer commentedYes it works for me, thanks for the patch!
Comment #6
j1mb0b CreditAttribution: j1mb0b as a volunteer commentedComment #8
MiroslavBanov CreditAttribution: MiroslavBanov at FFW commentedFixed.