For some reason we have ended up with rather duplicate functionality between this alter hook:
// Allow other modules to add or remove sorts.
drupal_alter('apachesolr_sort_links', $sort_links);
and the methods to add and remove sorts via the query object:
$query->set_available_sort('comment_count', array('title' => t('Most comments'), 'default' => 'desc'));
$query->remove_available_sort('sort_name');
Should we just remove the alter hook in 7.x? Is there a use case for having it in addition?
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | 1053126-addon.patch | 444 bytes | nick_vh |
| #6 | 1053126.patch | 1.07 KB | nick_vh |
| #2 | 1053126-2.patch | 1.01 KB | jpmckinney |
Comments
Comment #1
pwolanin commentedComment #2
jpmckinney commentedRemoves alter hook.
Comment #3
pwolanin commentedHmm, I'm remembering/wondering if that's useful for e.g. re-ordering the sort links, etc?
Comment #4
jpmckinney commentedHmm, true - there is no way to do that using the $query object. But can't reordering happen at the theme layer with theme('apachesolr_sort_list')?
Comment #5
nick_vhSorts now can be re-arranged by using this
#1324842: Add setAvailableSorts to the api
Marking it as reviewed and tested :)
Comment #6
nick_vhRerolled patch
Comment #7
nick_vhRemoved an additional line
Comment #8
nick_vhBoth have been committed