[Zope-dev] "REQUEST" considered a string

Rob Miller rob.at.kalistra.dot.com@zope.org
Fri, 28 Jul 2000 00:09:21 -0700


The following DTML method works in Zope 2.1.6, but not in 2.2.0:
("testfs" is a LocalFS product installed in the method's folder)

--------------------
<dtml-var standard_html_header>
<dtml-call "REQUEST.set('spec', '*')">
<dtml-call "REQUEST.set('num_dir_columns', 3)">
<table>
<dtml-call "REQUEST.set('ctr', 0)">
<dtml-in "testfs.fileValues(REQUEST.get('spec', _.None))">
<dtml-if "type == 'directory'">
<dtml-if "ctr % num_dir_columns == 0">
<tr>
</dtml-if>
<td><a href="<dtml-var URL1>/<dtml-var url>"><dtml-var "id"></a><br>
<dtml-if "ctr % num_dir_columns == num_dir_columns - 1">
</tr>
</dtml-if>
<dtml-call "REQUEST.set('ctr', _.int(ctr) + 1)">
</dtml-if>
</dtml-in>
<dtml-comment> In case we end in the middle of a row... </dtml-comment>
<dtml-if "ctr % num_dir_columns != 0">
</tr>
</dtml-if>
</table>
<dtml-var standard_html_footer>
----------------------

The error that this causes in 2.2.0 is:

----------------------
Error Type: AttributeError
Error Value: 'string' object has no attribute 'set
----------------------

The traceback reveals that the line where the error occurs is
"<dtml-call "REQUEST.set('ctr', _.int(ctr) + 1)">".  Zope is acting as though
the REQUEST object is a string!

I'm posting this to Zope-dev to see if any of you folks who are familiar with
the innards can tell me if this is happening because there's a bug in 2.2.0, or
if there's something that has changed within Zope that I need to account for in
my code.  If this is a bug, where is the proper place to report it?  I've heard
mention of something called a collector, but all of my searches on zope.org are
resulting in error messages right now, so I don't know what it is or how to
find it.

thanks for any help or feedback,

rob