[Zope-CMF] found actions bug in CMF HEAD and CMF 1.4 I suppose

Gregoire Weber gregoire.weber@switzerland.org
Thu, 03 Jul 2003 17:46:22 +0200


Hi all,

while playing around with ArchExample (from Archetypes) which
uses old string based actions (not TALES actions) I found out=20
that CMF HEAD of 2003/07/03 of about 1200+0200 does not=20
convert the last action of a fti to a TALES expression.

Have a look at ActionProviderBase.py method addAction:

   new_actions =3D self._cloneActions() # line 114

   does the conversion of string actions to TALES actions
   (the conversion is actually done in getActionExpression
   in ActionInformation.py).

   then the new action is created (but not converted !!!):

      new_action =3D ActionInformation(...)

   and added to the actions list:

      new_actions.append(new_action)

addAction is called in in the __init__ method in the
TypeInformation class in TypesTool.py in a for loop
looping over all actions.

This way the last string action never gets converted to=20
a TALES expression action.

I tried to bug fix this behaviour in setActionExpression
but doing that I've broken code at another place.

I now fix that problem for me by doing a dummy read
access to 'new_action' before it's appended to new_actions
(addAction in ActionProviderBase.py):

   new_action =3D ActionInformation(...)

   # dummy read ensures conversion to TALES expression (XXX)
   new_action.getActionExpression()

   new_actions.append( new_action )
=20
I'm not sure where to fix that bug cleanly as the action=20
code is somehow complex, nicely said :-(

I put that on the list in the hope somebody knows, how to=20
fix that in a correct manner.

Gregoire

P.S.: It seems that is the bug we searched at the Plone=20
sprint in Padua: see thread "some CMF 1.4beta1 issues" in may
_____________________________________
Gr=E9goire Weber
mailto:gregoire.weber@switzerland.org