opencredit / BadgeOS-Community-Add-on

The "BadgeOS Community Add-on" integrates BadgeOS features into BuddyPress and bbPress. Site members complete achievements and earn badges based on a range of community activity and triggers. This add-on to BadgeOS also includes the ability to display badges and achievements on user profiles and activity feeds.
GNU Affero General Public License v3.0
11 stars 8 forks source link

do not override global $user_ID #59

Closed cherbst closed 8 years ago

cherbst commented 8 years ago

overriding the global $user_ID changes the global user context and can have unwanted side effects

tw2113 commented 8 years ago

Not denying or closing without merge, but curious if you have any specific examples of things going wrong because of this? Probably more for personal education than anything. Otherwise, I'm not seeing anything wrong with this.

cherbst commented 8 years ago

I hit a strange bug with this where triggers got logged for the wrong user. For me the bug happend with #58 included when a filter was added to change the user_id. But I think this can also lead to bugs where the 'groups_join_specific_group' filter is changing the current $user_ID.