#7296 closed defect (bug) (fixed)
BuddyPress Private groups showing "Request Membership" Tab to admin/users
Reported by: | sbrajesh | Owned by: | boonebgorges |
---|---|---|---|
Milestone: | 2.7 | Priority: | high |
Severity: | major | Version: | |
Component: | Groups | Keywords: | has-patch |
Cc: | sbrajesh |
Description
With the addition of magical getter/setter in BP_Groups_Group, It is no longer possible to add random data on the group object.
This cause issues with exiting code that dynamically added property on the group object. One such issue in the BuddyPress core has cropped up on private Groups.
If you are the admin of the private group and visit it, you will see the Request membership navigation link in addition to other links.
This is happening because the Groups component sets up dynamic property 'is_user_member' but it is not available due to getters/setters.
The solution is to modify the definitions of the magical methods(get/set, isset) and use an array to store/retrieve random property.
Please find the patch attached.
Attachments (1)
Change History (5)
This ticket was mentioned in Slack in #buddypress by boone. View the logs.
8 years ago
#2
@
8 years ago
Thanks for the report, @sbrajesh. I'm not sure that we always need to maintain backward compatibility for arbitrary properties, but we absolutely cannot break compatibility with is_user_member
(and front_template
, which suffers from the same problem).
At the moment, I don't see a benefit to storing arbitrary data in an array rather than directly as properties on the object; this would be useful if we were protecting access somehow, or if we did actual OOP things with the object, but we don't.
Fix the magic method bugs