[CMF-checkins] CVS: CMF/CMFCore - ActionProviderBase.py:1.7

Tres Seaver tseaver@zope.com
Thu, 21 Mar 2002 16:47:17 -0500


Update of /cvs-repository/CMF/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv15450/CMFCore

Modified Files:
	ActionProviderBase.py 
Log Message:


  - Fix sharing bug pointed out by Dieter Maurer (Tracker #484)
    in ActionProviderBase.  Thanks for the patch!


=== CMF/CMFCore/ActionProviderBase.py 1.6 => 1.7 ===
             if not action['name']:
                 raise ValueError('A name is required.')
-            a = actions[idx]
+
+	    # DM: do not override shared element!
+            # a = actions[idx]
+	    class Empty: pass
+	    a= Empty()
+
             a.id = action['id']
             a.title = action['name']
             if action['action'] is not '':
@@ -161,6 +166,18 @@
             a.permissions = action['permissions']
             a.category = action['category']
             a.visible = action['visible']
+
+	    # DM - unshare! severe sharing bug via class variable "_actions"
+	    actions[idx]= ActionInformation(
+	       id= a.id,
+	       title= a.title,
+	       action= a._action,
+	       condition= a.condition,
+	       permissions= a.permissions,
+	       category= a.category,
+	       visible= a.visible,
+	       )
+ 
         self._actions = actions
         if REQUEST is not None:
             return self.manage_editActionsForm(REQUEST, manage_tabs_message=