[Zope3-Users] Standard Macros

Hassan Alirezaei hassan at isi.imi.i.u-tokyo.ac.jp
Sat Feb 10 09:51:37 EST 2007


The situation is very simple. I have a fresh instance of zope3.
when I try to add a ZPT Page through ZMI and enter the following html  
for  the source:

<html metal:use-macro="context/@@standard_macros/page">
    <div metal:fill-slot="body">bla bla bla</div>
</html>

No error will occur during the adding of the ZPT Page. However, when I 
try to view the ZPT Page as an "Unauthenticated User" or another PAU 
principal,  I will get the error which I added the traceback to the end 
of my post. It basically complains that it cannot traverse to the 
'title' attribute of the principal!  Now, I don't get the error If I 
view the ZPT Page as a ZCML "Manager" .

It is very easy to try it yourself and see the error! I would appreciate 
any help. thanks alot in advance. Hass

Here is the traceback:

  File "/usr/local/Zope-3.3.0/lib/python/zope/tales/tales.py", line 704, 
in evaluateText
    text = self.evaluate(expr)
  File "/usr/local/Zope-3.3.0/lib/python/zope/tales/tales.py", line 696, 
in evaluate
    return expression(self)
   - 
/usr/local/Zope-3.3.0/lib/python/zope/app/rotterdam/template_tablelayout.pt
   - Line 50, Column 36
   - Expression: <PathExpr standard:u'request/principal/title'>
   - Names:
      {'args': (),
       'container': <zope.app.folder.folder.Folder object at 0xb6e3242c>,
       'context': <zope.app.folder.folder.Folder object at 0xb6e3242c>,
       'default': <object object at 0xb7d95568>,
       'loop': {},
       'nothing': None,
       'options': {},
       'repeat': {},
       'request': <zope.publisher.browser.BrowserRequest instance 
URL=http://192.168.1.2:8080/ZPTPage>,
       'template': <zope.app.zptpage.zptpage.ZPTPage object at 0xb5365aac>,
       'usage': <zope.pagetemplate.pagetemplate.TemplateUsage object at 
0xb4ee2d6c>}
  File "/usr/local/Zope-3.3.0/lib/python/zope/tales/expressions.py", 
line 217, in __call__
    return self._eval(econtext)
  File "/usr/local/Zope-3.3.0/lib/python/zope/tales/expressions.py", 
line 194, in _eval
    ob = self._subexprs[-1](econtext)
  File "/usr/local/Zope-3.3.0/lib/python/zope/tales/expressions.py", 
line 124, in _eval
    ob = self._traverser(ob, element, econtext)
  File 
"/usr/local/Zope-3.3.0/lib/python/zope/app/pagetemplate/engine.py", line 
68, in __call__
    request=request)
  File "/usr/local/Zope-3.3.0/lib/python/zope/traversing/adapters.py", 
line 164, in traversePathElement
    return traversable.traverse(nm, further_path)
   - __traceback_info__: 
(<zope.app.security.principalregistry.UnauthenticatedPrincipal object at 
0xb6a42dac>, 'title')
  File "/usr/local/Zope-3.3.0/lib/python/zope/traversing/adapters.py", 
line 52, in traverse
    raise TraversalError(subject, name)
   - __traceback_info__: 
(<zope.app.security.principalregistry.UnauthenticatedPrincipal object at 
0xb6a42dac>, 'title', [])
TraversalError: 
(<zope.app.security.principalregistry.UnauthenticatedPrincipal object at 
0xb6a42dac>, 'title')








Maciej Wisniowski wrote:
>> I have the same problem. I just know the problem is with the
>> principal_info macro and it only occurs when one is logged in with a PAU
>> principal (ZCML principals do fine as far as I remember).
>>     
> 'same problem' is not enough I think. What is the traceback etc?
>
>   



More information about the Zope3-users mailing list