Opened 4 years ago
Closed 4 years ago
#8375 closed defect (bug) (fixed)
BP_Invitation_Manager::get_table_name should have a filter
Reported by: | shawfactor | Owned by: | dcavins |
---|---|---|---|
Milestone: | 7.0.0 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Core | Keywords: | has-patch commit |
Cc: |
Description
The new Buddypress invitation api is great but my setup is unusual, and there is no way of filtering the table used to store the invitations. A simple improvement would be to add a filter to the above static method.
line 364 of the following file
bp-core-admin-tools.php
would also need to be fixed as it queries the database directy. I think this is a mistake anyway and ideally should reference BP_Invitation_Manager::get_table_name() anyway.
What do you all think?
Attachments (2)
Change History (19)
This ticket was mentioned in Slack in #buddypress by dcavins. View the logs.
4 years ago
#3
@
4 years ago
- Keywords has-patch commit added
- Milestone changed from Awaiting Review to 7.0.0
Hi @dcavins patch looks good 👌
#6
@
4 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
Guys thankyou but is it possible to move the filter to after
buddypress()->table_prefix is added?
or add two filters?
I ask as the if you are running running multiblog (like I am) but want some shared tables then you currently can´t share the invitations table.
You can for the full components using the meta_tables and global_tables filters e.g. for messages you can change the whole table name using:
bp_messages_global_tables
bp_messages_meta_tables
But there are no equivalents for notifications.
Thats what i am really trying to get towards, and I think for consistency this would also benefit buddypress. i guess this would also require a filter of the invitation meta table as well but as far as I can see that table is not used at all atm?
#7
@
4 years ago
Ha, I thought it would be annoying to have to strip out the buddypress()->table_prefix
in most use cases, so I added the filter before the prefix was added. Can you be more specific about how you'd use the filter?
Thanks!
#8
@
4 years ago
I run buddypress on a multisite with multiblog set to true (effectively so each site has its own budddypress). But I want to share some tables (actually all tables should be shared except the xprofile ones). This is achievable for all tables that are part of a fully fledged component as I can filter them.
eg for messages I filter
bp_messages_global_tables
bp_messages_meta_tables
With the filter replacing the local table prefix with the prefix of the root blog.
However this is currently imposssible for invitations. Therefore I need a filter after the prefix is added so I can replace the local prefix with that of the root blog and have a global invitations table
Does this make sense?
I am not sure how this works with inviation meta too, I can´t even find functions for that atm?
thankyou again.
This ticket was mentioned in Slack in #buddypress by dcavins. View the logs.
4 years ago
This ticket was mentioned in Slack in #buddypress by imath. View the logs.
4 years ago
#11
@
4 years ago
- Milestone 7.0.0 deleted
- Resolution set to worksforme
- Status changed from reopened to closed
This looks great and is more consistent with the component setup.
#13
@
4 years ago
@dcavins it looks good to me, I’m just amazed the patch doesn’t include the removal of the filter we committed before 🤔. Have you refreshed your fork with latest BuddyPress trunk ?
#14
@
4 years ago
- Milestone set to 7.0.0
This was scheduled for 7.0.0 milestone and it’s still the case.
Thanks for opening this ticket. I agree that the admin tool is incorrect, and I don't see any problem with adding a filter for, uh, unusual setups. I'll add a patch and look for a 2nd opinion.
Thanks!