[ZCM] [ZC] 1810/ 6 Comment "Undo : empty list in Zope 2.7.6"
Collector: Zope Bugs, Features,
and Patches ...
zope-coders-admin at zope.org
Wed Aug 10 07:58:11 EDT 2005
Issue #1810 Update (Comment) "Undo : empty list in Zope 2.7.6"
Status Accepted, Zope/bug medium
To followup, visit:
http://www.zope.org/Collectors/Zope/1810
==============================================================
= Comment - Entry #6 by efge on Aug 10, 2005 7:58 am
Also note the explanation at http://mail.zope.org/pipermail/zope-cmf/2005-August/022759.html
________________________________________
= Comment - Entry #5 by Witsch on Aug 9, 2005 4:23 pm
Uploaded: "zopeundo.diff"
- http://www.zope.org/Collectors/Zope/1810/zopeundo.diff/view
well, since i've tracked down the problem, fixed it and wrote a
followup to http://www.zope.org/Collectors/Zope/1726 before i
found this post, i thought i'd upload my patch here again...
imho Prefix.py.patch (as uploaded by zegor) fixes the problem only
halfway, since two users with the same id but defined in different
acl_users (within the same subtree) could still conflict. okay,
i suppose that's a very unlikely case, but anyway... :)
________________________________________
= Assign - Entry #4 by mj on Aug 5, 2005 12:01 pm
The bug desc is accurate. Any Zope transaction has a 'user_name' datapoint attached of the form 'path username' with the path (omitting the first slash) denotes the parent path of where the user is defined. So a user spam in the root folder will create transactions with a ' spam' log while a user eggs in the foo/bar acl_users folder has 'foo/bar eggs' logged as the user_name. The undoable_transactions machinery uses this information to limit the returned list of transactions to only those in the same subtree as the user requesting the information.
Unfortunately slinkp changed the Prefix matching code in ZopeUndo package from string-matching to path-matching, causing the behavior observed. Because path matching is used, the machinery wants to filter for all 'user_name' records prefixed with the current user's source location (for root users the prefix is omitted). So for user eggs Prefix('foo/bar') is used. This is then split into ['foo', 'bar'] wich then fails to match against the stored ['foo', 'bar eggs'] because the new code doesn't take the space and username into account.
Assigning to Paul as responsible as this needs to be fixed throughout wherever his new code was applied. Paul, also notify Tim Peters as this affects ZODB code.
________________________________________
= Assign - Entry #3 by mj on Aug 5, 2005 12:01 pm
Status: Pending => Accepted
Supporters added: slinkp
The bug desc is accurate. Any Zope transaction has a 'user_name' datapoint attached of the form 'path username' with the path (omitting the first slash) denotes the parent path of where the user is defined. So a user spam in the root folder will create transactions with a ' spam' log while a user eggs in the foo/bar acl_users folder has 'foo/bar eggs' logged as the user_name. The undoable_transactions machinery uses this information to limit the returned list of transactions to only those in the same subtree as the user requesting the information.
Unfortunately slinkp changed the Prefix matching code in ZopeUndo package from string-matching to path-matching, causing the behavior observed. Because path matching is used, the machinery wants to filter for all 'user_name' records prefixed with the current user's source location (for root users the prefix is omitted). So for user eggs Prefix('foo/bar') is used. This is then split into ['foo', 'bar'] wich then fails to match against the stored ['foo', 'bar eggs'] because the new code doesn't take the space and username into account.
Assigning to Paul as responsible as this needs to be fixed throughout wherever his new code was applied. Paul, also notify Tim Peters as this affects ZODB code.
________________________________________
= Comment - Entry #2 by efge on Aug 4, 2005 10:56 am
Thanks but in what situation is a space present in the path?
What code inserts this?
We need this information to provide a proper unit test.
________________________________________
= Request - Entry #1 by zegor on Jun 14, 2005 1:11 pm
Uploaded: "Prefix.py.patch"
- http://www.zope.org/Collectors/Zope/1810/Prefix.py.patch/view
Users declared in subfolders cannot undo actions because action's lists are always empty.
Only users in the root acl_users can undo actions.
This bug has been introduced in Zope 2.7.6 for collector #1726.
I try to correct this by stripping username in path in Prefix.py and it seems work.
I attach my patch to this collector.
==============================================================
More information about the Zope-Collector-Monitor
mailing list