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.
This patch adds three new options to the list handling dropdown in the views field settings form namely:
- Sum: provides the numerical sum of the data (can be used for example calculating totals).
- Min: show the minimum of the data in the list.
- Max: show the maximum (I use it for example to calculate the last date of a date field in the index - for the current record).
Comment | File | Size | Author |
---|---|---|---|
#1 | 1200952--views-field-handlers.patch | 4.19 KB | drunken monkey |
2011_06_27_search_api_views_field_handler_patch_01.patch | 1.4 KB | bpeter | |
Comments
Comment #1
drunken monkeyGood idea!
However, I'm sorry but after taking a look at the method (my code, not yours), I just can't stand keeping it that way. Please review the attached patch with this feature, some refactoring and a completely unrelated fix for the entity field handler.
Again, sorry. ;)
Comment #2
drunken monkeyThe Entity API is now responsible for the field handlers – but this is still a good idea (in my opinion). We'd just need to update the patch (if this would be approved by fago).
Comment #3
drunken monkeyJust tried to implement this for the Entity API, but had to realize that list handling for entity-valued fields is broken anyways (at least when using
count
orfirst
, and the new ones would have had similar problems). Field API fields have their own mechanism and other kinds of fields are a pain to add for testing.So, we should probably first fix the existing method, and then implement this analogously.
Comment #4
NWOM CreditAttribution: NWOM commentedSince this issue is a bit older, was wondering if anyone came up with a solution or is this perhaps integrated somehow? Since standard views aggregation does not work, and since the Views Calc module appears to not be compatible with Search API, I'm still on the search for an available option.
Thanks in advance!