This one isn't of much use via the UI, but it's very useful for developers building data programmatically with Views. In particular, the Custom Pagers module: I need to run the View twice, once getting entries *higher* than a particular one in a sort, then again getting all values *less* than another.
Not all 'sort' handlers have an accompanying 'filter' handler, so programmatically adding a filter for each sort isn't possible. This code (suggested by merlinofchaos) adds a $sort->filter($operator, $value) function to the default sort handler. It would apply the sort as usual but also act as a built-in 'cutoff' for values above or below a particular spot in the sort. This is not currently exposed in the UI, but exists so developers doing similar things can quickly slice-and-dice a sorted view even if there are no matching filters defined.
Code needs testing, I was about to test another set of patches and wanted to make sure I rolled this and posted it so it didn't get munched when I applied subsequent patches.
Comment | File | Size | Author |
---|---|---|---|
sort_filter.patch | 1.92 KB | eaton | |
Comments
Comment #1
drewish CreditAttribution: drewish commentedsubscribing
Comment #2
dawehnerThis definitive nehttp://drupal.org/files/issues/sort_filter.patcheds work, because it uses includes/query.inc
Comment #3
esmerel CreditAttribution: esmerel commentedSending this to the postponed bucket unless someone has time/inclination to work on it.
Comment #4
merlinofchaos CreditAttribution: merlinofchaos commentedI'd like to unbury this. This has always been something I wanted...
Comment #5
MustangGB CreditAttribution: MustangGB commented