[Zope] redirect strangeness ...

Charlie Reiman creiman@kefta.com
Mon, 26 Aug 2002 09:54:46 -0700


I can't say specifically, but %3A is ':', so I'd guess marshaformvars() is
returning something with a ':' in it, which might confuse the browser. Try
URL encoding that part.

FWIW, using the standard headers and footers is a waste of time here, since
redirect is part of the HTTP headers which appears before any HTML.

> -----Original Message-----
> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of
> Dennis Allison
> Sent: Sunday, August 25, 2002 9:46 PM
> To: zope@zope.org
> Subject: [Zope] redirect strangeness ...
>
>
> This dtml fragment fails strangely ---
>
>    <dtml-var standard_header_html>
>    <dtml-if expr=pythonscript()>
>    	<dtml-call expr="REQUEST['RESPONSE'].redirect('index_html')">
>    <dtml-else>
>    	<dtml-call
> expr="REQUEST['RESPONSE'].redirect('originalform?'+marshallformvars())">
>    </dtml-if>
>    <dtml-var standard_footer_html>
>
> The pythonscript() validates the form variables.  marshallformvars()
> is a python script that returns the appropriately quoted name/value pairs.
>
> The observed behavior is strange.  If the pythonscript() returns 0, the
> transfer to the originalform occurs along with the diagnostic information
> inserted by the validation script.  This is the behavior I expect.
>
> But when the pythonscript() returns 1, I get a Zope error indicating
> that the sytem cannot find, not index_html but
>
> 	/aaa/bbb/ccc/ddd/%3A
>
> Both the index_html and the failing dtml-method are in the folder
> referenced via the path /aaa/bbb/ccc/ddd.
>
> As a workaround I replaced the first redirect with a <dtml-var index_html>
> but I do wonder why the initial approach failed.  Insight appreciated.
>
> -dra
>
> _______________________________________________
> 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 )
>