[Zope] dtml-var weirdness

Dieter Maurer dieter@handshake.de
Wed, 20 Feb 2002 00:08:21 +0100


Joseph A Knapka writes:
 > Stupid question of the day:
This does not seem stupid at all!

 > Why might the following code result in a KeyError? It does
 > in some contexts under Zope 2.5.0.
 > 
 > <dtml-if expr="REQUEST.has_key('xyz')">
 > <dtml-else>
 >   <dtml-call expr="REQUEST.set('xyz','Hello world')">
 > </dtml-if>
 > 
 > Sometimes the next line results in a KeyError, value 'xyz':
 > 
 > <dtml-var name="xyz">
 > 
 > In such cases, this works fine:
 > 
 > <dtml-with REQUEST only>
 >   <dtml-var name="xyz">
 > </dtml-with>
This appears to be a bug.

   When you happen to reproduce it, we may be able to analyse its cause.


Dieter