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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kingmackenzie created an issue. See original summary.

j1mb0b’s picture

Title: Apachsolr views sorting not working with setAvailableSort() » Apach Solr views sorting not working with setAvailableSort()
j1mb0b’s picture

Issue summary: View changes
MiroslavBanov’s picture

Status: Active » Needs review
FileSize
502 bytes

Does this patch work for your problem? It aims to completely prevent query alter hooks from changing the sort.

j1mb0b’s picture

Yes it works for me, thanks for the patch!

j1mb0b’s picture

Status: Needs review » Reviewed & tested by the community

  • MiroslavBanov committed 09925b1 on 7.x-1.x
    Issue #2628236 by MiroslavBanov, kingmackenzie: Apach Solr views sorting...
MiroslavBanov’s picture

Status: Reviewed & tested by the community » Fixed

Fixed.

Status: Fixed » Closed (fixed)

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