[Zope] Acquisition Problem ?

Farrell, Troy troy.farrell@wilcom.com
Fri, 9 Mar 2001 13:47:33 -0600


You have an instance of variable-clobbering.  abc_text is acquired from the
dtml-let inside mydtml_1.  You have set the value in REQUEST, but REQUEST is
at the bottom of the list when variable names are looked up.  This is
explained on page 15 of the Document Template Markup Language Reference.
Unfortunately, I can't find a link for it.

Ok, I found it in the Zope Book
http://www.zope.org/Members/michel/ZB/AdvDTML.dtml
First section.

Troy

-----Original Message-----
From: Richard Moon [mailto:richard@dcs.co.uk]
Sent: Friday, March 09, 2001 12:56 PM
To: zope@zope.org
Subject: [Zope] Acquisition Problem ?


Can anyone explain what's going on here - please ?

I've got a dtml method 'mydtml_1' which processes a file uploaded via a 
form - like this

<dtml-in "abcfile_read(REQUEST)">
   <dtml-let abc_text=sequence-item>
     <dtml-unless "_.len(abc_text)==0">
       <dtml-var mydtml_2>
     </dtml-unless>
   </dtml-let>
</dtml-in>

In the dtml method mydtml_2 I have some code like this

<dtml-var 
expr="REQUEST.set('abc_text',external_method_that_returns_hello_world(abc_te
xt))>
<dtml-var REQUEST>
<dtml-var abc_text>

What happens is that the
<dtml-var REQUEST> shows abc_text having the new value of "Hello World"

but the
<dtml-var abc_text> shows the value as it was in mydtml_1

Presumably <dtml-var abc_text> is acquiring the value from mydtml_1.

Can anyone tell me why ?

And how to get <dtml-var abc_text> to return the value I want i.e. "Hello 
World" ?

This is Zope 2.2.1


(Note - if I do not put <dtml-var mydtml_2> inside the <dtml-in> and 
<dtml-let> constructs then it works as expected, e.g.
<dtml-call "REQUEST.set('abc_text','Goodbye Forever')">
<dtml-var mydtml_2>

  will render "Hello World" )

Many thanks


Richard Moon
richard@dcs.co.uk



_______________________________________________
Zope maillist  -  Zope@zope.org
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )