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.
A follow up to #1969088: Changes to group browsing widget & user status updates. Add a filter to choose between followed and not followed content.
Comment | File | Size | Author |
---|---|---|---|
#5 | 1985188-5-commons_bw-following-filter.patch | 911 bytes | itamar |
#5 | 1985188-5-commons_follow-following-filter.patch | 3.21 KB | itamar |
#5 | 1985188-5-commons_origins-following-filter.patch | 3.1 KB | itamar |
#5 | following.png | 37.5 KB | itamar |
#2 | 1985188-commons_bw-following-filter.patch | 1.78 KB | itamar |
Comments
Comment #1
ezra-g CreditAttribution: ezra-g commentedThanks, itamar. The third option is meant to be "all content" (eg, regardless of following).
Comment #2
itamar CreditAttribution: itamar commentedNotice these patches are supposed to be applied after #1969088: Changes to group browsing widget & user status updates is merged.
Comment #3
itamar CreditAttribution: itamar commentedSetting as ready for review.
Comment #4
ezra-g CreditAttribution: ezra-g commentedThanks, itamar.
A) I applied the patches on top of the previously referenced patches, and the filters display in the order "Limited to...Sorted by" but the designs call for the opposite order.
B) There's no "all content" (regardless of whether the user follows) as specified in #1.
C) I notice that these patches add the "following" relationships and filters into the Views definitions, and also add integrations from Commons Radioactivity.
The pattern we're currently following with changes to the bw views is to use a views_default_views_alter() hook for add-on functionality so that sites can disable the Radioactivity feature without having broken/overidden views. From commons_radioactivity.module:
My expectation (and I'm certainly open to feedback otherwise) is that we'd do the same for Commons Follow. Hopefully, since this would be a single alter implementation instead of a patch to each of the content type modules that makes the work here easier.
However, since we're adding a relationship as well, this may introduce more complexity than it's worth, and since the Commons Follow system is more fundamental to the product than radioactivity, I'm open to adding Commons Follow as a dependency for the content type modules.
@itamar/amitaibu: This is a good example of a pattern in Commons that hasn't been tested until a major refactoring such as this one - I really value your feedback as skilled developers getting acquainted with Commons in validating or revising these patterns :).
Comment #5
itamar CreditAttribution: itamar commentedI rewrote it using hook_views_default_views_alter as you suggested which indeed makes this patch a lot more elegant.
In the previous version I forgot the patch to the theme, and that's why you saw the filters in the wrong order.
Comment #6
ezra-g CreditAttribution: ezra-g commentedThis worked as expected in my testing. Marking RTBC pending #1969088: Changes to group browsing widget & user status updates.
Comment #7
ezra-g CreditAttribution: ezra-g commentedCommitted to Commons Follow: http://drupalcode.org/project/commons_follow.git/commit/e4c23e1.
Looks like the BW patch was included in #1969088: Changes to group browsing widget & user status updates.
Themeing will happen in #1990256: Theme updates for new Browsing widget.
Thanks, itamar!