[ZCM] [ZC] 2327/ 1 Request "Five's pagetemplate expects too much of context"
"Collector: Zope Bugs, Features, and Patches ..." <[email protected]> Tue, 22 May 2007 10:14:12 -0400
| Newsgroups | gmane.comp.web.zope.devel.collector-monitor |
|---|---|
| Message-ID | <[email protected]> |
Issue #2327 Update (Request) "Five's pagetemplate expects too much of context"
Status Pending, Zope/bug medium
To followup, visit:
http://www.zope.org/Collectors/Zope/2327
==============================================================
= Request - Entry #1 by tseaver on May 22, 2007 10:14 am
Uploaded: "five-render_unwrapped.patch"
- http://www.zope.org/Collectors/Zope/2327/five-render_unwrapped.patch/view
The 'pt_getContext' method of
Products.Five.browser.pagetemplatefile.ZopeTwoPageTemplateFile
makes too many unnecessary assumptions about ite context:
- It insists on finding a 'getPhysicalRoot' method on either its
own context (the view) or on the view's context. Putting
'None' into the namespace for the 'root' key should be fine.
- It presumes that its context (the view) will be acquisition
wrapped, which is not a hard requirement.
Both of these assumptions make it hard to write tests for
the "renderability" of particular templates. The attached patch,
made against the version of Five currently on the Zope 2.10 branch,
softens those requirements, and adds a test which demonstrates
that a template which does not itself need either 'root' or
'context' can be rendered.
==============================================================