[Zope] redirect strangeness ...
Dennis Allison
allison@sumeru.stanford.EDU
Sun, 25 Aug 2002 21:45:32 -0700
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