Resources

My Agape try

Your Agape try


Support Forum

You must be logged in to post Login Register

Search 
Search Forums:


 




Issue with role cache and add_group_user()

UserPost

7:25 am
February 1, 2012


metal450

Member

posts 178

1

Hey Kevin,

I found a bit of an issue with role caching.  Consider an existing user who is not a member of a group.  That user then performs some action (in my case, connecting their WP account with Facebook) which adds them to a group via the function ScoperAdminLib::add_group_user($groupid, $userid).  After that point, the user is in some places identified as a member of the group and in some places not - until I manually flush the role cache via the admin panel.

Example: When viewing "All Users" in the admin panel, the Groups column does show them as a member of that group.  However, if I then edit the user, the "Active Groups" selectbox DOES NOT show them as a member of that group.  Likewise, the user does not have access to posts/pages to which group membership should entitle them.

I did see that there's already a call to flush_groups_cache_for_user() at the end of that function, so presumably something else needs to be flushed but isn't.

Note that I'm still using 1.3.44.

12:11 pm
February 10, 2012


Kevin

Admin

posts 2503

2

For now, just replace the contents of function flush_groups_cache_for_user with the following:

wpp_cache_flush();

8:22 pm
February 10, 2012


metal450

Member

posts 178

3

Will this be fixed in 1.3.55?  Will it have a significant performance impact on whenever that function is called to add a new user to a group?

8:00 am
February 13, 2012


Kevin

Admin

posts 2503

4

metal450 said:

Will this be fixed in 1.3.55?  

Yes

Will it have a significant performance impact on whenever that function is called to add a new user to a group?

No, it just deletes several files. There is no "rebuild index" type of processing overhead. The moderate performance impact is on each user's subsequent next site access. There will be more queries prior to their cache being rebuilt.

8:37 am
February 13, 2012


metal450

Member

posts 178

5

Great, thanks - sounds good :)


About the Agapetry forum

Currently Online:

11 Guests

Maximum Online: 150

Forums:

Groups: 2

Forums: 7

Topics: 1247

Posts: 5656

Members:

There are 1259 members

There are 1 guests


Kevin has made 2503 posts

Top Posters:

metal450 - 178

Ragnar - 108

YikYak - 70

whiteorb - 49

Daisy - 35

Administrator: Kevin | Moderators: Kevin