Comment 1 for bug 562262

Revision history for this message
Wichert Akkerman (wichert) wrote :

I am not sure if this is related or warrants a separate bug: the grok.template directive does allow a path separator in its parameter, but the result is a somewhat nasty error on zope startup:

  File "/Users/wichert/Library/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/xmlconfig.py", line 649, in file
    context.execute_actions()
  File "/Users/wichert/Library/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/config.py", line 605, in execute_actions
    callable(*args, **kw)
  File "/Users/wichert/Library/eggs/grokcore.view-1.12.2-py2.6.egg/grokcore/view/meta/views.py", line 90, in checkTemplates
    has_render, has_no_render)
  File "/Users/wichert/Library/eggs/grokcore.view-1.12.2-py2.6.egg/grokcore/view/templatereg.py", line 135, in checkTemplates
    (component_name.title(), factory), factory)
ConfigurationExecutionError: <class 'martian.error.GrokError'>: View <class 'plonetheme.nuplone.skin.error.Error'> has no associated template or 'render' method.
  in:
  File "/Users/wichert/Work/syslab/euphorie/buildout/trunk/src/NuPlone/plonetheme/nuplone/configure.zcml", line 22.2-22.27
    <grok:grok package="." />

> /Users/wichert/Library/eggs/grokcore.view-1.12.2-py2.6.egg/grokcore/view/templatereg.py(135)checkTemplates()
-> (component_name.title(), factory), factory)

the relevant source is correct:

log=logging.getLogger(__name__)

grok.templatedir("templates")

class Error(grok.View):
    grok.context(Exception)
    grok.layer(NuPloneSkin)
    grok.name("index.html")
    grok.template("errors/generic")

    def update(self):
        self.exception=aq_inner(self.context)
        self.context=aq_parent(self)
        log.exception("Error at %r", self.context)