macros not traversable with Zope 2.13.9 and zope.pagetemplate 3.6.*

Bug #854060 reported by Erich Seifert
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zope 2
Won't Fix
Undecided
Unassigned

Bug Description

I have updated an existing Zope 2.13.7 instance to Zope-2.13.9 and zope.pagetemplate 3.6.1 package. After the update page templates that used macros didn't work any more. Errors show that the "macros" attribute isn't traversable.

For example, a zope page template containing XHTML and a METAL macro like 'metal:use-macro="here/standard_template.pt/macros/page"' fails with

Zope Error
Zope has encountered an error while publishing this resource.
Error Type: NotFound
Error Value: macros
...

Page templates without macros render correctly.

Here's the stack trace from the event.log:

2011-09-14T18:00:00 ERROR root Exception while rendering an error message
Traceback (most recent call last):
  File "/usr/lib64/zope-2.13/lib/python-2.7/OFS/SimpleItem.py", line 241, in
raise_standardErrorMessage
    v = s(**kwargs)
  File "/usr/lib64/zope-2.13/lib/python-2.7/Shared/DC/Scripts/Bindings.py",
line 322, in __call__
    return self._bindAndExec(args, kw, None)
  File "/usr/lib64/zope-2.13/lib/python-2.7/Shared/DC/Scripts/Bindings.py",
line 359, in _bindAndExec
    return self._exec(bound_data, args, kw)
  File
"/usr/lib64/zope-2.13/lib/python-2.7/Products/PageTemplates/ZopePageTemplate.py",
line 334, in _exec
    result = self.pt_render(extra_context=bound_names)
  File
"/usr/lib64/zope-2.13/lib/python-2.7/Products/PageTemplates/ZopePageTemplate.py",
line 431, in pt_render
    result = PageTemplate.pt_render(self, source, extra_context)
  File
"/usr/lib64/zope-2.13/lib/python-2.7/Products/PageTemplates/PageTemplate.py",
line 79, in pt_render
    showtal=showtal)
  File "/usr/lib64/python2.7/site-packages/zope/pagetemplate/pagetemplate.py",
line 131, in pt_render
  File "/usr/lib64/python2.7/site-packages/zope/pagetemplate/pagetemplate.py",
line 240, in __call__
  File "/usr/lib64/python2.7/site-packages/zope/tal/talinterpreter.py", line
266, in __call__
  File "/usr/lib64/python2.7/site-packages/zope/tal/talinterpreter.py", line
338, in interpret
    s = s[:76] + "...\n"
  File "/usr/lib64/python2.7/site-packages/zope/tal/talinterpreter.py", line
862, in do_useMacro
    def do_useMacro(self, (macroName, macroExpr, compiledSlots, block),
  File "/usr/lib64/python2.7/site-packages/zope/tales/tales.py", line 696, in
evaluate
    return expression(self)
  File "/usr/lib64/python2.7/site-packages/zope/tales/expressions.py", line
217, in __call__
    return self._eval(econtext)
  File
"/usr/lib64/zope-2.13/lib/python-2.7/Products/PageTemplates/Expressions.py",
line 147, in _eval
    ob = self._subexprs[-1](econtext)
  File "/usr/lib64/python2.7/site-packages/zope/tales/expressions.py", line
124, in _eval
    ob = self._traverser(ob, element, econtext)
  File
"/usr/lib64/zope-2.13/lib/python-2.7/Products/PageTemplates/Expressions.py",
line 74, in boboAwareZopeTraverse
    object = object.restrictedTraverse(name)
  File "/usr/lib64/zope-2.13/lib/python-2.7/OFS/Traversable.py", line 316, in
restrictedTraverse
  File "/usr/lib64/zope-2.13/lib/python-2.7/OFS/Traversable.py", line 299, in
unrestrictedTraverse
NotFound: macros

After going back to zope.pagetemplate 3.5.2 all pages render correctly.

The issue has been discussed already on the Gentoo bug tracker:
https://bugs.gentoo.org/show_bug.cgi?id=382977

Revision history for this message
Hanno Schlichting (hannosch) wrote :

Zope 2.13 supports zope.pagetemplate 3.5.x as expressed in its known good version set.

zope.pagetemplate 3.6.1 is currently only compatible with the yet unreleased Zope 4.0. Some unreleased changes on zope.pagetemplate trunk (to be released in 3.6.2) will likely make it backwards compatible. Even though the use of the 3.6.x line with Zope 2.13 isn't and won't be supported.

Changed in zope2:
status: New → Won't Fix
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.