Opened 11 years ago
Closed 8 years ago
#2452 closed defect (bug) (fixed)
Multisite dynamic user roles bug
Reported by: | maniu | Owned by: | johnjamesjacoby |
---|---|---|---|
Milestone: | 2.6 | Priority: | high |
Severity: | normal | Version: | 2.2 |
Component: | API - Roles/Capabilities | Keywords: | has-patch |
Cc: |
Description
Hello
WP:3.4-3.6
bbPress: 2.3.2-2.4.1
It took me some time but i finally have figured out that dynamic roles that are getting assigned to users when "Auto Role" is disabled are being unset before bp_forum_enforce_blocked is triggered.
This results in 404 for users.
add_action( 'template_redirect', 'bbp_set_current_user_default_role', 7 );
managed to fix it for me but i am not sure what is un-setting dynamically assigned roles and if my fix does not have any down-site.
Hope my input helps.
Thanks,
Maniu
Change History (13)
#2
@
11 years ago
- Milestone changed from Awaiting Review to 2.5
- Owner set to johnjamesjacoby
Moving to 2.5 to research further.
#3
@
11 years ago
- Milestone changed from 2.5 to 2.6
Unable to duplicate this, but my guess is there is a rogue call to switch_to_blog()
occurring, that's causing the current user's roles and capabilities to be flushed. Any more insight you can provide would be really helpful.
Moving to 2.6 so we can get 2.5 out.
#4
@
11 years ago
please ignore/delete this comment i thought i could confirm this but i was not checking it correctly. having a similar issue but not sure if tis the same one at this point.
Would be interested to see what exactly is causing this problem and how your solution this fixes it.
bbp_set_current_user_default_role
has adid_action( 'set_current_user' )
failsafe to prevent it from running more than once under normal operating conditions, which leads me to believe something unpredicted is happening.Related: #WP23016