[Plone-UI] RE: [Plone-developers] Plone group editing bug #2821 - Managing groups from control panel
dhopkins at DonHopkins.com
Thu May 26 09:31:21 UTC 2005
Here are some clues I've gathered, that might suggest where something is
going wrong to somebody who understands the big picture.
I created a new user, and opened two windows side by side:
1) ZMI on the Plone site's
acl_users/<username>/manage_workspace?FORCE_USER=1, to examine the
GRUF's idea of the user's groups.
2) Plone on the site's prefs_user_memberships?userid=<username>, to edit
and examine Plone's idea of the user's groups.
Then I tried adding the user to a group, with window #2, by checking the
group and pressing "Add User to Selected Groups".
The group did not show up in the user's list of groups, so I've
triggered the bug.
(Sometimes the bug doesn't manifest and the group shows up the first
time. In that case, you have to create a new user to reproduce the bug.
The bug only happens with new users, and after a while it just starts
working for no reason, and keeps working for that user.)
Refresh the ZMI window displaying the user's group. That window does
show that the user has been added to the group!
Refresh the Plone window viewing the prefs_user_memberships template, to
see if the bug is sticking. Usually that page does NOT show the user has
been added to the group. Refresh a few times to make sure it keeps
sticking. (Sometimes it stops sticking after a few refreshes, even
though the server wasn't doing anything else.)
Refresh the ZMI window displaying the user's group. That window still
shows that the user has been added to the group.
Refresh the Plone window again to if the bug is still sticking. This
demonstrates that looking at the GRUF groups through ZMI doesn't update
Plone's incorrect cache.
So there must be a cache somewhere in Plone that's not getting
invalidated. I don't think it could be uncommitted transactions, because
the bug sticks across many page refreshes.
Refresh the Plone page a few times. Sometime that will unstick the bug
eventually, but sometimes it keeps sticking.
Add some more groups with the Plone page. Usually that will unstick the
bug after a few tries, but sometimes not.
Eventually the bug unsticks and you can see all the groups you've added
in Plone, but I can't determine what it is that I've done that unsticks
it, because it's so irregular.
Once it's unstuck for a user, it stays that way. When you restart Plone,
all users are unstuck. It's only when you add groups to users you've
just created, that this bug manifests itself. Unfortunately that's when
I usually want to add groups!
I tried the obvious approach of calling a useful-sounding method called
GRUFUser.clearCachedGroupsAndRoles, after adding the groups in
prefs_user_membership_edit.py, but that did not fix the problem.
So I put a debug statement into the clearCachedGroupAndRoles method, and
it's called all the time, again and again. That raises the question of
why is there a cache if it's always being invalidated so often? Yet it's
still not invalidating some other cache at the right time.
It must have to do with some other cache, but I haven't been able to
track it down. This member/user/underlying/group/role/gruff plug-in
stuff is quite complicated! I'd appreciate any insight you have to share
about what's going on, or where I should look.
From: Dominic Hiles [mailto:Dominic.Hiles at bristol.ac.uk]
Sent: Thursday, May 26, 2005 1:18 AM
To: Don Hopkins
Cc: plone-developers-admin at lists.sourceforge.net
Subject: Re: [Plone-developers] Plone group editing bug #2821 - Managing
groups from control panel
> If anyone can reproduce this intermittent bug, please tell me what
> of user folder setup are you using?
I was the "Anonymous User" on that bug report. I'm afraid that I don't
have much to add other than my Entry #4. However, it's still replicable
for me across different Plone instances on different servers using the
"out-the-box" Plone (2.0.5 in my case) and GRUF (2.0.1 as packaged with
2.0.5). As you say, the problem is intermittent.
As I mentioned on the bug report, my limited efforts at debugging did
to suggest that the template was returning *before* the user had been
to the groups, but I failed to work out how/why this might happen.
Sorry I couldn't be of more help - I'd love to see someone fix this bug
More information about the UI