[CMF-checkins] CVS: CMF/CMFCore - ActionInformation.py:1.10.2.3 ActionsTool.py:1.31.2.3
Chris McDonough
chrism@zope.com
Wed, 31 Jul 2002 16:16:30 -0400
Update of /cvs-repository/CMF/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv23946
Modified Files:
Tag: chrism-actions-branch
ActionInformation.py ActionsTool.py
Log Message:
Whoops, fix a __setstate__ bug in ActionInformation.
=== CMF/CMFCore/ActionInformation.py 1.10.2.2 => 1.10.2.3 ===
from Globals import DTMLFile
from Acquisition import aq_inner, aq_parent
from OFS.SimpleItem import SimpleItem
-
+from Persistence import Persistent
from Expression import Expression
from CMFCorePermissions import View
from CMFCorePermissions import ManagePortal
@@ -179,13 +179,16 @@
def __setstate__(self, state):
if not state.has_key('_action_info'):
- kw = {}
- for name in ('id', 'title', 'description', 'category', 'condition',
+ state['_action_info'] = {}
+ id = state['id']
+ state['_acton_info']['id'] = id
+ _marker = []
+ for name in ('title', 'description', 'category', 'condition',
'permissions', 'priority', 'visible', 'action'):
- kw[name] = state.get(name)
- del state[name]
- self._action_info = kw
- self.__dict__.update(state)
+ if state.get(name, _marker) is not _marker:
+ state['_action_info'][name] = state[name]
+ del state[name]
+ Persistent.__setstate__(self, state)
InitializeClass( ActionInformation )
=== CMF/CMFCore/ActionsTool.py 1.31.2.2 => 1.31.2.3 ===
if object is not None and hasattr(object, 'aq_base'):
folder = self._findParentFolder(object)
- # include actions from action providers
- actions.extend(self.getProviderActions(oai(self, folder, object)))
-
# include actions from types tool
actions.extend(self.getTypeActions(object))
+
+ # include actions from action providers
+ actions.extend(self.getProviderActions(oai(self, folder, object)))
# Reorganize the actions by category, filtering out disallowed actions.
filtered_actions={