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.
Since unflagged content comes in with a flag weight of 0, it makes the sort "ascending" less than optimal since uflagged content comes up first. It would be great to have another views sort option, flagged / not-flagged. That way, you could first sort on flagged items and then by ascending.
Comment | File | Size | Author |
---|---|---|---|
#5 | 1355864.5.FlagViewsSort7x2x.patch | 2.7 KB | socketwench |
#3 | 1355864.2.flag_.views-sort-by-flagged.patch | 2.74 KB | joachim |
#2 | 1355864.flag_.views-sort-by-flagged.patch | 2.83 KB | joachim |
Comments
Comment #1
joachim CreditAttribution: joachim commentedSorting by the flagged time works, though obviously if you wanted a secondary sort on say the title you'd run into problems.
This would need a custom handler that casts the flagged time to a boolean that can then be sorted on.
Comment #2
joachim CreditAttribution: joachim commentedComment #3
joachim CreditAttribution: joachim commentedIssue #1355864 by joachim: Added a Views sort handler for flagged / unflagged.
Committed this patch with the handler tweaked slightly.
Comment #4
joachim CreditAttribution: joachim commentedCould be backported fairly easily:
- for 7--2, change the table names
- for 6--2, check handler methods work with Views 2.
Comment #5
socketwench CreditAttribution: socketwench commented7.x-2.x backpoint.
Comment #6
joachim CreditAttribution: joachim commentedThanks for the backport. Committed.