Opened 7 years ago
Closed 7 years ago
#7859 closed enhancement (fixed)
Allow querying for all group invitations sent by a user
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.0 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Groups | Keywords: | has-patch 2nd-opinion |
Cc: |
Description
There's currently no way to get a list of all group invitations sent by a user. All methods of querying for invitations sent by a user are pinned to a specific group. We need something more general for #7820.
Related: #6210 cc @dcavins
My initial intuition was to add support to BP_Group_Member_Query
, but that class is very heavily tied to a single group ID. So, for the purposes of this ticket and #7820, I'll probably introduce something bespoke, which will be narrow in purpose.
Attachments (2)
Change History (6)
#2
@
7 years ago
Hi Boone-
Your proposed function seems fine to me. I'm not crazy about the name, since it's finding all invites of any status, not invites that are "sent," but that's just because the whole invitation lexicon is confusing.
Re #6210, I've recently (last week) had some thoughts about how I can heave it over the finish line. When that happens, we can switch out your new function for the more general purpose fetchers I've built.
Thanks!
#3
@
7 years ago
@dcavins Thanks so much for having a look.
Thinking about this more, I wonder if it might just be better to have a generic "getter" for membership objects - even one that's specific for the purposes of personal data export. This makes it possible to do pagination etc in a way that's consistent across different types of 'memberships'. I'm about to attach a patch that does this.
7859.diff is a very straightforward but very single-purpose method. (For the real deal I might need to add pagination arguments in order to support batch-processing.)
Obviously, it's not beautiful or desirable to introduce this sort of thing. But I don't see a way of getting the data through one of our existing tools (
groups_get_groups()
,BP_Group_Member_Query
) without extensive and dangerous refactoring, and it feels wasteful to build more robust tools to query this data when such queries are not needed elsewhere in BP at the moment.@dcavins Your thoughts about this would be valuable. (If you have the spirit, after the tumbleweeds in #6210.)