[Zope-CMF] Re: [Zope] CMF reconfiguration error

Tres Seaver tseaver@digicool.com
Tue, 03 Apr 2001 20:50:41 -0400


Jeff Senn wrote:
> 
> [on the Zope list] "Hans de Wit" <hw@scp.nl> writes:
> 
> > I tried the CMF on a clean Zope 2.3.1 configuration. Everything went pretty good, except
> > for the reconfiguration of the portal:
> >
> > Error Type: TypeError
> > Error Value: expected integer key
> >
> > The traceback is in the end of this message.
> >
> > I am using a Windows machine, so the assumptions in the readme are not completely met:
> 
> I have the same problem on a linux install (fresh Zope 2.3.1 and CMF 1.0).
> 
> Help!

I can reproduce this problem.  The culprit is the "dtml-return"
tag in CMFDefault/skins/control/reconfig.dtml.  This patch clears
it right up (I've just checked it in):

------- begin patch ------------------
Index: CMFDefault/skins/control/reconfig.dtml
===================================================================
RCS file: /cvs-repository/CMF/CMFDefault/skins/control/reconfig.dtml,v
retrieving revision 1.1
diff -u -u -r1.1 reconfig.dtml
--- CMFDefault/skins/control/reconfig.dtml	2001/02/23 14:24:09	1.1
+++ CMFDefault/skins/control/reconfig.dtml	2001/04/04 00:59:33
@@ -1,2 +1,3 @@
 <dtml-call expr="portal_properties.editProperties(REQUEST)">
-<dtml-return expr="reconfig_form(_.None, _, portal_status_message='Settings changed')">
+<dtml-call expr="REQUEST['RESPONSE'].redirect( portal_url()
+                  + '/reconfig_form?portal_status_message=Settings+changed.')"


-------- end patch -------------------

That said, I would like to declare jihad against the use of "dtml-return"
as a quasi-optimization to avoid a second trip on the wire:

 * It causes the URL bar to lie about the actual method producing
   the response;

 * It yields bizarre error cases, which never show up in the logically
   equivalent redirect.

Tres.
-- 
===============================================================
Tres Seaver                                tseaver@digicool.com
Digital Creations     "Zope Dealers"       http://www.zope.org