2.13.23 broken in resolving <dtml-var> tags

Bug #1542031 reported by Dieter Stubler
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zope 2
Invalid
Undecided
Unassigned

Bug Description

Easy to reproduce
Create a python script bug just containing:

return 1

Create a dmtl-document 'test'with in the same folder containing:

<dtml-var "bug()">

and a python script bug in the same folder:

return 1

view it in 2.13.22 and earlier just gives you

1

But 2.13.23 chokes on hat:

Site Error

An error was encountered while publishing this resource.

Error Type: NameError
Error Value: name 'bug' is not defined

And the error log:

Traceback (innermost last):
  Module ZPublisher.Publish, line 138, in publish
  Module ZPublisher.mapply, line 77, in mapply
  Module ZPublisher.Publish, line 48, in call_object
  Module OFS.DTMLDocument, line 98, in __call__
   - <DTMLDocument at /BUG/test>
   - URL: http://localhost:8080/BUG/test/manage_main
   - Physical Path: /BUG/test
  Module DocumentTemplate.DT_String, line 477, in __call__
  Module DocumentTemplate.DT_Util, line 210, in eval
   - __traceback_info__: bug
  Module <string>, line 1, in <expression>
NameError: name 'bug' is not defined

This is a complete killer and not just a flaw, it makes our whole web interface unusable

Revision history for this message
pseudonomous (fdruec1) wrote :

I don't think this is a problem just with python scripts. I've got some zope dtml code that's pretty standard (in fact similar code appears in the zope2 book as example code) that includes one dtml method in another and it fails with a "KeyError".

Create yourself a dtml method with contents:

<dtml-var standard_html_header>
<p>
Hello World!
</p>
<dtml-var standard_html_footer>

Down in the root folder I have these 2 dtml methods:

standard_html_header:
<html>
  <head><title>&dtml-title_or_id;</title></head>
  <body bgcolor="#FFFFFF">

standard_html_footer:
  </body>
</html>

You'll get a traceback if you try to visit the "test" dtml method:

Traceback (innermost last):
  Module ZPublisher.Publish, line 138, in publish
  Module ZPublisher.mapply, line 77, in mapply
  Module ZPublisher.Publish, line 48, in call_object
  Module OFS.DTMLMethod, line 137, in __call__
   - <DTMLMethod at /test>
   - URL: http://wwwtest:8080/test/manage_main
   - Physical Path: /test
  Module DocumentTemplate.DT_String, line 477, in __call__
KeyError: 'standard_html_header'

This happens in zope 2.13.23 and the recently released 2.13.24.

The method renders correctly in zope 2.13.22.

Note: I filed another bug report about my standard_error_message DTML not rendering correctly; I strongly suspect that this is related to the bug here, but I can't be certain.

Revision history for this message
Colin Watson (cjwatson) wrote :

The zope2 project on Launchpad has been archived at the request of the Zope developers (see https://answers.launchpad.net/launchpad/+question/683589 and https://answers.launchpad.net/launchpad/+question/685285). If this bug is still relevant, please refile it at https://github.com/zopefoundation/zope2.

Changed in zope2:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.