[CMF-checkins] CVS: CMF/CMFCore - ActionInformation.py:1.9.4.1

Tres Seaver tseaver@zope.com
Mon, 8 Jul 2002 16:12:49 -0400


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

Modified Files:
      Tag: CMF-1_3-branch
	ActionInformation.py 
Log Message:
 - Merge instance fixup from HEAD.

=== CMF/CMFCore/ActionInformation.py 1.9 => 1.9.4.1 ===
         info['id'] = self.id
         info['name'] = self.Title()
-        info['url'] = self.action and self.action( ec ) or ''
+        action_obj = self._getActionObject()
+        info['url'] = action_obj and action_obj( ec ) or ''
         info['permissions'] = self.getPermissions()
         info['category'] = self.getCategory()
         info['visible'] = self.getVisibility()
         return info 
 
-    security.declarePublic( 'getActionExpression' )
-    def getActionExpression( self ):
+    security.declarePrivate( '_getActionObject' )
+    def _getActionObject( self ):
 
-        """ Return the text of the TALES expression for our URL.
+        """ Find the action object, working around name changes.
         """
         action = getattr( self, 'action', None )
 
@@ -120,6 +121,14 @@
                 self.action = self._action
                 del self._action
 
+        return action
+
+    security.declarePublic( 'getActionExpression' )
+    def getActionExpression( self ):
+
+        """ Return the text of the TALES expression for our URL.
+        """
+        action = self._getActionObject()
         return action and action.text or ''
 
     security.declarePublic( 'getCondition' )