AttributeError('getFolderContents',) message on Plone 4 with customised navigation - plone

This is a follow up question to this question, which explains the setup etc.
For anyone needing a quick summary:
I have made a secondary navigation by modifying the global.sections viewlet in portal_view_customizations, it is currently working fine except for one problem.
The Problem
It seems that I am unable to log into my site, or go to mysite.com/plone_control_panel. I receive an error regarding Plone compaining about getFolderContents.
Modified Globalnav TALES:
<tal:sections tal:define="portal_tabs view/portal_tabs"
tal:condition="portal_tabs"
i18n:domain="plone">
<h5 class="hiddenStructure" i18n:translate="heading_sections">Sections</h5>
<ul id="portal-globalnav"
tal:define="selected_tab python:view.selected_portal_tab"
><tal:tabs tal:repeat="tab portal_tabs"
><li tal:define="tid tab/id"
tal:attributes="id string:portaltab-${tid};
class python:selected_tab==tid and 'selected' or 'plain'"
><a href=""
tal:content="tab/name"
tal:attributes="href tab/url;
title tab/description|nothing;">
Tab Name
</a></li></tal:tabs></ul>
<tal:subsections tal:define="isDocument python:getattr(context,'portal_type','') == 'Document';
isFolder python:getattr(context,'portal_type','') == 'Folder';
subitemsDocument python:context.aq_parent.aq_inner.getFolderContents(contentFilter={'portal_type':'Document'});
subitemsFolder python:context.getFolderContents(contentFilter={'portal_type':'Document'});
root_url context/portal_url;
front_url string:${root_url}/front-page;
current_url context/absolute_url;">
<ul id="subnav" tal:condition="isFolder">
<tal:subtabsfolder tal:repeat="subitem subitemsFolder">
<li tal:define="item_url subitem/getURL"
tal:attributes="class python:current_url==item_url and 'selected' or 'plain'">
<a tal:attributes="href subitem/getURL" tal:content="subitem/Title"/>
</li>
</tal:subtabsfolder>
</ul>
<ul id="subnav" tal:condition="isDocument">
<tal:subtabsdocument tal:repeat="subitem subitemsDocument">
<li tal:define="item_url subitem/getURL"
tal:attributes="class python:current_url==item_url and 'selected' or 'plain'">
<a tal:attributes="href subitem/getURL" tal:content="subitem/Title"
tal:condition="python:front_url != current_url"/>
</li>
</tal:subtabsdocument>
</ul>
</tal:subsections>
</tal:sections>
The Error received in browser window:
AttributeError('getFolderContents',) (Also, the following error occurred while attempting to render the standard error message, please see the event log for full details: getFolderContents)
What I managed to get from the logs:
Module zope.pagetemplate.pagetemplate, line 113, in pt_render
Module zope.tal.talinterpreter, line 271, in __call__
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 531, in do_optTag_tal
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 742, in do_insertStructure_tal
Module Products.PageTemplates.Expressions, line 220, in evaluateStructure
Module zope.tales.tales, line 696, in evaluate
- URL: /usr/local/Plone/buildout-cache/eggs/plone.app.layout-2.0.7-py2.6.egg/plone/app/layout/viewlets/portal_header.pt
- Line 2, Column 4
- Expression: <StringExpr u'plone.portalheader'>
- Names:
{'args': (),
'container': <PloneSite at /mysite-draft>,
'context': <PloneSite at /mysite-draft>,
'default': <object object at 0xb7ee76d8>,
'here': <PloneSite at /mysite-draft>,
'loop': {},
'nothing': None,
'options': {},
'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0xb56411c>,
'request': <HTTPRequest, URL=http://myserver.com/mysite-draft/login_form>,
'root': <Application at >,
'template': <Products.Five.browser.pagetemplatefile.ViewPageTemplateFile object at 0xc04898c>,
'traverse_subpath': [],
'user': <PropertiedUser 'dan'>,
'view': <Products.Five.viewlet.viewlet.SimpleViewletClass from /usr/local/Plone/buildout-cache/eggs/plone.app.layout-2.0.7-py2.6.egg/plone/app/layout/viewlets/portal_header.pt object at 0x10c0f9ec>,
'views': <Products.Five.browser.pagetemplatefile.ViewMapper object at 0x10c0fe4c>}
Module zope.contentprovider.tales, line 80, in __call__
Module plone.app.viewletmanager.manager, line 154, in render
Module plone.app.viewletmanager.manager, line 85, in render
Module five.customerize.zpt, line 143, in render
Module Products.PageTemplates.ZopePageTemplate, line 335, in _exec
Module Products.PageTemplates.ZopePageTemplate, line 432, in pt_render
Module Products.PageTemplates.PageTemplate, line 80, in pt_render
Module zope.pagetemplate.pagetemplate, line 113, in pt_render
Module zope.tal.talinterpreter, line 271, in __call__
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 852, in do_condition
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 533, in do_optTag_tal
Module zope.tal.talinterpreter, line 518, in do_optTag
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 583, in do_setLocal_tal
Module zope.tales.tales, line 696, in evaluate
- URL: /mysite-draft/front-page/zope.interface.interface-plone.global_sections
- Line 20, Column 12
- Expression: <PythonExpr context.aq_parent.aq_inner.getFolderContents(contentFilter={'portal_type':'Document'})>
- Names:
{'container': <PloneSite at /mysite-draft>,
'context': <PloneSite at /mysite-draft>,
'default': <object object at 0xb7ee76d8>,
'here': <PloneSite at /mysite-draft>,
'loop': {},
'nothing': None,
'options': {'args': ()},
'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0xf66a824>,
'request': <HTTPRequest, URL=http://myserver.com/mysite-draft/login_form>,
'root': <Application at >,
'template': <TTWViewTemplate at /mysite-draft/zope.interface.interface-plone.global_sections>,
'user': <PropertiedUser 'dan'>,
'view': <five.customerize.zpt.TTWViewlet object at 0xd6e274c>}
Module Products.PageTemplates.ZRPythonExpr, line 49, in __call__
- __traceback_info__: context.aq_parent.aq_inner.getFolderContents(contentFilter={'portal_type':'Document'})
Module PythonExpr, line 1, in <expression>
AttributeError: getFolderContents
------
2013-07-30T10:59:08 ERROR root Exception while rendering an error message
Traceback (most recent call last):
File "/usr/local/Plone/buildout-cache/eggs/Zope2-2.12.16-py2.6-linux-i686.egg/OFS/SimpleItem.py", line 254, in raise_standardErrorMessage
v = s(**kwargs)
File "/usr/local/Plone/buildout-cache/eggs/Products.CMFCore-2.2.2-py2.6.egg/Products/CMFCore/FSPythonScript.py", line 130, in __call__
return Script.__call__(self, *args, **kw)
File "/usr/local/Plone/buildout-cache/eggs/Zope2-2.12.16-py2.6-linux-i686.egg/Shared/DC/Scripts/Bindings.py", line 324, in __call__
return self._bindAndExec(args, kw, None)
File "/usr/local/Plone/buildout-cache/eggs/Products.PloneHotfix20110531-2.0-py2.6.egg/Products/PloneHotfix20110531/__init__.py", line 106, in _patched_bindAndExec
return self._original_bindAndExec(args, kw, caller_namespace)
File "/usr/local/Plone/buildout-cache/eggs/Zope2-2.12.16-py2.6-linux-i686.egg/Shared/DC/Scripts/Bindings.py", line 361, in _bindAndExec
return self._exec(bound_data, args, kw)
File "/usr/local/Plone/buildout-cache/eggs/Zope2-2.12.16-py2.6-linux-i686.egg/Products/PythonScripts/PythonScript.py", line 344, in _exec
result = f(*args, **kw)
File "Script (Python)", line 34, in standard_error_message
File "/usr/local/Plone/buildout-cache/eggs/Zope2-2.12.16-py2.6-linux-i686.egg/Shared/DC/Scripts/Bindings.py", line 324, in __call__
return self._bindAndExec(args, kw, None)
File "/usr/local/Plone/buildout-cache/eggs/Products.PloneHotfix20110531-2.0-py2.6.egg/Products/PloneHotfix20110531/__init__.py", line 106, in _patched_bindAndExec
return self._original_bindAndExec(args, kw, caller_namespace)
File "/usr/local/Plone/buildout-cache/eggs/Zope2-2.12.16-py2.6-linux-i686.egg/Shared/DC/Scripts/Bindings.py", line 361, in _bindAndExec
return self._exec(bound_data, args, kw)
File "/usr/local/Plone/buildout-cache/eggs/Products.CMFCore-2.2.2-py2.6.egg/Products/CMFCore/FSPageTemplate.py", line 240, in _exec
result = self.pt_render(extra_context=bound_names)
File "/usr/local/Plone/buildout-cache/eggs/Products.CMFCore-2.2.2-py2.6.egg/Products/CMFCore/FSPageTemplate.py", line 180, in pt_render
self, source, extra_context
File "/usr/local/Plone/buildout-cache/eggs/Zope2-2.12.16-py2.6-linux-i686.egg/Products/PageTemplates/PageTemplate.py", line 80, in pt_render
showtal=showtal)
File "/usr/local/Plone/buildout-cache/eggs/zope.pagetemplate-3.5.2-py2.6.egg/zope/pagetemplate/pagetemplate.py", line 113, in pt_render
strictinsert=0, sourceAnnotations=sourceAnnotations)()
File "/usr/local/Plone/buildout-cache/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 271, in __call__
self.interpret(self.program)
File "/usr/local/Plone/buildout-cache/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 343, in interpret
handlers[opcode](self, args)
File "/usr/local/Plone/buildout-cache/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 888, in do_useMacro
self.interpret(macro)
File "/usr/local/Plone/buildout-cache/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 343, in interpret
handlers[opcode](self, args)
File "/usr/local/Plone/buildout-cache/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 533, in do_optTag_tal
self.do_optTag(stuff)
File "/usr/local/Plone/buildout-cache/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 518, in do_optTag
return self.no_tag(start, program)
File "/usr/local/Plone/buildout-cache/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 513, in no_tag
self.interpret(program)
File "/usr/local/Plone/buildout-cache/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 343, in interpret
handlers[opcode](self, args)
File "/usr/local/Plone/buildout-cache/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 852, in do_condition
self.interpret(block)
File "/usr/local/Plone/buildout-cache/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 343, in interpret
handlers[opcode](self, args)
File "/usr/local/Plone/buildout-cache/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 531, in do_optTag_tal
self.no_tag(stuff[-2], stuff[-1])
File "/usr/local/Plone/buildout-cache/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 513, in no_tag
self.interpret(program)
File "/usr/local/Plone/buildout-cache/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 343, in interpret
handlers[opcode](self, args)
File "/usr/local/Plone/buildout-cache/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 742, in do_insertStructure_tal
structure = self.engine.evaluateStructure(expr)
File "/usr/local/Plone/buildout-cache/eggs/Zope2-2.12.16-py2.6-linux-i686.egg/Products/PageTemplates/Expressions.py", line 220, in evaluateStructure
text = super(ZopeContext, self).evaluateStructure(expr)
File "/usr/local/Plone/buildout-cache/eggs/zope.tales-3.4.0-py2.6.egg/zope/tales/tales.py", line 696, in evaluate
return expression(self)
File "/usr/local/Plone/buildout-cache/eggs/zope.contentprovider-3.5.0-py2.6.egg/zope/contentprovider/tales.py", line 80, in __call__
return provider.render()
File "/usr/local/Plone/buildout-cache/eggs/plone.app.viewletmanager-2.0.1-py2.6.egg/plone/app/viewletmanager/manager.py", line 154, in render
return BaseOrderedViewletManager.render(self)
File "/usr/local/Plone/buildout-cache/eggs/plone.app.viewletmanager-2.0.1-py2.6.egg/plone/app/viewletmanager/manager.py", line 85, in render
return u'\n'.join([viewlet.render() for viewlet in self.viewlets])
File "/usr/local/Plone/buildout-cache/eggs/zope.app.pagetemplate-3.7.1-py2.6.egg/zope/app/pagetemplate/simpleviewclass.py", line 44, in __call__
return self.index(*args, **kw)
File "/usr/local/Plone/buildout-cache/eggs/Zope2-2.12.16-py2.6-linux-i686.egg/Products/Five/browser/pagetemplatefile.py", line 126, in __call__
return self.im_func(im_self, *args, **kw)
File "/usr/local/Plone/buildout-cache/eggs/Zope2-2.12.16-py2.6-linux-i686.egg/Products/Five/browser/pagetemplatefile.py", line 60, in __call__
sourceAnnotations=getattr(debug_flags, 'sourceAnnotations', 0),
File "/usr/local/Plone/buildout-cache/eggs/zope.pagetemplate-3.5.2-py2.6.egg/zope/pagetemplate/pagetemplate.py", line 113, in pt_render
strictinsert=0, sourceAnnotations=sourceAnnotations)()
File "/usr/local/Plone/buildout-cache/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 271, in __call__
self.interpret(self.program)
File "/usr/local/Plone/buildout-cache/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 343, in interpret
handlers[opcode](self, args)
File "/usr/local/Plone/buildout-cache/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 531, in do_optTag_tal
self.no_tag(stuff[-2], stuff[-1])
File "/usr/local/Plone/buildout-cache/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 513, in no_tag
self.interpret(program)
File "/usr/local/Plone/buildout-cache/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 343, in interpret
handlers[opcode](self, args)
File "/usr/local/Plone/buildout-cache/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 742, in do_insertStructure_tal
structure = self.engine.evaluateStructure(expr)
File "/usr/local/Plone/buildout-cache/eggs/Zope2-2.12.16-py2.6-linux-i686.egg/Products/PageTemplates/Expressions.py", line 220, in evaluateStructure
text = super(ZopeContext, self).evaluateStructure(expr)
File "/usr/local/Plone/buildout-cache/eggs/zope.tales-3.4.0-py2.6.egg/zope/tales/tales.py", line 696, in evaluate
return expression(self)
File "/usr/local/Plone/buildout-cache/eggs/zope.contentprovider-3.5.0-py2.6.egg/zope/contentprovider/tales.py", line 80, in __call__
return provider.render()
File "/usr/local/Plone/buildout-cache/eggs/plone.app.viewletmanager-2.0.1-py2.6.egg/plone/app/viewletmanager/manager.py", line 154, in render
return BaseOrderedViewletManager.render(self)
File "/usr/local/Plone/buildout-cache/eggs/plone.app.viewletmanager-2.0.1-py2.6.egg/plone/app/viewletmanager/manager.py", line 85, in render
return u'\n'.join([viewlet.render() for viewlet in self.viewlets])
File "/usr/local/Plone/buildout-cache/eggs/five.customerize-1.0-py2.6.egg/five/customerize/zpt.py", line 143, in render
return template._exec(bound_names, args, kwargs)
File "/usr/local/Plone/buildout-cache/eggs/Zope2-2.12.16-py2.6-linux-i686.egg/Products/PageTemplates/ZopePageTemplate.py", line 335, in _exec
result = self.pt_render(extra_context=bound_names)
File "/usr/local/Plone/buildout-cache/eggs/Zope2-2.12.16-py2.6-linux-i686.egg/Products/PageTemplates/ZopePageTemplate.py", line 432, in pt_render
result = PageTemplate.pt_render(self, source, extra_context)
File "/usr/local/Plone/buildout-cache/eggs/Zope2-2.12.16-py2.6-linux-i686.egg/Products/PageTemplates/PageTemplate.py", line 80, in pt_render
showtal=showtal)
File "/usr/local/Plone/buildout-cache/eggs/zope.pagetemplate-3.5.2-py2.6.egg/zope/pagetemplate/pagetemplate.py", line 113, in pt_render
strictinsert=0, sourceAnnotations=sourceAnnotations)()
File "/usr/local/Plone/buildout-cache/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 271, in __call__
self.interpret(self.program)
File "/usr/local/Plone/buildout-cache/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 343, in interpret
handlers[opcode](self, args)
File "/usr/local/Plone/buildout-cache/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 852, in do_condition
self.interpret(block)
File "/usr/local/Plone/buildout-cache/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 343, in interpret
handlers[opcode](self, args)
File "/usr/local/Plone/buildout-cache/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 533, in do_optTag_tal
self.do_optTag(stuff)
File "/usr/local/Plone/buildout-cache/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 518, in do_optTag
return self.no_tag(start, program)
File "/usr/local/Plone/buildout-cache/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 513, in no_tag
self.interpret(program)
File "/usr/local/Plone/buildout-cache/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 343, in interpret
handlers[opcode](self, args)
File "/usr/local/Plone/buildout-cache/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 583, in do_setLocal_tal
self.engine.setLocal(name, self.engine.evaluateValue(expr))
File "/usr/local/Plone/buildout-cache/eggs/zope.tales-3.4.0-py2.6.egg/zope/tales/tales.py", line 696, in evaluate
return expression(self)
File "/usr/local/Plone/buildout-cache/eggs/Zope2-2.12.16-py2.6-linux-i686.egg/Products/PageTemplates/ZRPythonExpr.py", line 49, in __call__
return eval(self._code, vars, {})
File "PythonExpr", line 1, in <expression>
AttributeError: getFolderContents
Can anyone point me in the right direction with this?
I think the problem is related to aq_inner and/or aq_parent in my TALES however I have no idea how to accomplish what the TALES accomplishes without using them.
I even tried a TALES condition on the beggining <tal:subsections> tag to only show the navigation for anonymous users but I still receive the same error.
Any help is greatly appreciated.

The following expression is at fault:
subitemsDocument python:context.aq_parent.aq_inner.getFolderContents(contentFilter={'portal_type':'Document'});
Where context is the Plone site. The parent of a Plone site is the Zope root object, but the getFolderContents() skin method only exists within the Plone site.
It is not clear why you try to get the folder contents of the parent of the context; you may need to test if you are not at the site root here.

Related

Omit site site in returned result when using getPath in Plone page templates

I have a piece of TALES for a page template in Plone which looks through the results of a collection and inserts them into a box (similar to that of a collection portlet)
I have an issue in getting a URL from the returned items, I have been using getPath however it returns the site name, so my URLS end up being http://mysite.com/ThePloneSite/folder/page instead of just http://mysite.com/folder/page, currently my example TALES is as follows:
<a tal:attributes="href string:${item/getPath}/view">Item</a>
I have tried every variation I can imagine but I can't remember them all so here's a couple that don't work:
(this returns nothing)
<a tal:attributes="href item/absolute_url">Item</a>
this gives me a traceback, complaining about "getpath":
<a tal:attributes="python:item.getObject().absolute_url()">Item</a>
The only reason the site name being in the link is annoying is that in order to access the "State" and "Display" buttons you must click "View" after originally clicking on the link
NOTE: the last example works when you're using getFolderContents however I understand returning results from a collection are different.
Any help would be greatly appreciated, thanks.
EDIT Traceback for absolute version:
Traceback (innermost last):
Module ZPublisher.Publish, line 126, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 46, in call_object
Module Shared.DC.Scripts.Bindings, line 322, in __call__
Module Shared.DC.Scripts.Bindings, line 359, in _bindAndExec
Module Products.PageTemplates.ZopePageTemplate, line 334, in _exec
Module Products.PageTemplates.ZopePageTemplate, line 431, in pt_render
Module Products.PageTemplates.PageTemplate, line 79, in pt_render
Module zope.pagetemplate.pagetemplate, line 113, in pt_render
Module zope.tal.talinterpreter, line 271, in __call__
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 888, in do_useMacro
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 533, in do_optTag_tal
Module zope.tal.talinterpreter, line 518, in do_optTag
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 852, in do_condition
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 533, in do_optTag_tal
Module zope.tal.talinterpreter, line 518, in do_optTag
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 954, in do_defineSlot
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 852, in do_condition
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 946, in do_defineSlot
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 533, in do_optTag_tal
Module zope.tal.talinterpreter, line 518, in do_optTag
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 821, in do_loop_tal
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 405, in do_startTag
Module zope.tal.talinterpreter, line 482, in attrAction_tal
Module Products.PageTemplates.Expressions, line 225, in evaluateText
Module zope.tales.tales, line 696, in evaluate
- URL: /peacehospice/portal_skins/custom/home_page_view
- Line 200, Column 12
- Expression: <PythonExpr alldoc.getObject().absolute_url()>
- Names:
{'container': <PloneSite at /peacehospice>,
'context': <ATDocument at /peacehospice/front-page>,
'default': <object object at 0x7fbed9313b30>,
'here': <ATDocument at /peacehospice/front-page>,
'loop': {u'alldoc': <Products.PageTemplates.Expressions.PathIterator object at 0x7fbebcd20c50>},
'nothing': None,
'options': {'args': ()},
'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0x7fbebde89680>,
'request': <HTTPRequest, URL=http://demo.kcsts.co.uk/front-page/home_page_view>,
'root': <Application at >,
'template': <ZopePageTemplate at /peacehospice/home_page_view used for /peacehospice/front-page>,
'traverse_subpath': [],
'user': <PropertiedUser 'dan'>}
Module Products.PageTemplates.ZRPythonExpr, line 48, in __call__
- __traceback_info__: alldoc.getObject().absolute_url()
Module PythonExpr, line 1, in <expression>
Module AccessControl.ImplPython, line 716, in guarded_getattr
Module AccessControl.ImplPython, line 658, in aq_validate
Module AccessControl.ImplPython, line 552, in validate
Module AccessControl.ImplPython, line 322, in validate
Module AccessControl.ImplPython, line 749, in raiseVerbose
Module AccessControl.ImplPython, line 726, in item_repr
Module plone.app.contentlisting.catalog, line 29, in __repr__
Module plone.app.contentlisting.catalog, line 74, in getPath
Module Products.ZCatalog.CatalogBrains, line 51, in getPath
AttributeError: getpath
TALES for getting content of collection:
<div id="all-documents" tal:define="allDocsBatch python:context.documents.alldocuments.results(b_start=b_start,b_size=10)">
<h3>All Documents</h3>
<div class="tabbedWrapper">
<div class="item" tal:repeat="alldoc allDocsBatch">
<p>
<img tal:replace="structure alldoc/getIcon" />
<a tal:attributes="href python:alldoc.getObject().absolute_url()" tal:content="alldoc/Title" />
<span class="tags" tal:condition="alldoc/Subject" tal:define="alldoctag alldoc/Subject">
<a tal:repeat="tag alldoctag" tal:content="tag"
tal:attributes="href string:${context/portal_url}/##search?Subject:list=${tag}"/>
</span>
</p>
</div>
</div>
</div>
EDIT #2
NOTE found a link http://copilotco.com/mail-archives/plone-users.2007/msg05113.html which may help but haven't had a chance to look at it just yet.
If item is a catalog brain (as in your example) you need to call item/getURL. absolute_url is for real objects.

Plone 3.3.5 Document_view attribute error

Plone n00b here, continuing migration issues from 2.5 to 3.3.5.
To eliminate any potential problems I cleared out the custom folder and tried to get the pages to show up. When I go to a page that isn't the front page I get an:
AttributeError _v_transform.
Here is the traceback:
Exception traceback
Time 2012/09/13 08:18:06.733 GMT-7
User Name (User Id) Anonymous User (None)
Request URL http://localhost:8080/mission-vision/index_html/document_view
Exception Type AttributeError
Exception Value _v_transform
Traceback (innermost last):
Module ZPublisher.Publish, line 119, in publish
Module ZPublisher.mapply, line 88, in mapply
Module ZPublisher.Publish, line 42, in call_object
Module Shared.DC.Scripts.Bindings, line 313, in __call__
Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec
Module Products.CMFCore.FSPageTemplate, line 216, in _exec
Module Products.CMFCore.FSPageTemplate, line 155, in pt_render
Module Products.PageTemplates.PageTemplate, line 98, in pt_render
Module zope.pagetemplate.pagetemplate, line 117, in pt_render
Module zope.tal.talinterpreter, line 271, in __call__
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 891, in do_useMacro
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 536, in do_optTag_tal
Module zope.tal.talinterpreter, line 521, in do_optTag
Module zope.tal.talinterpreter, line 516, in no_tag
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 957, in do_defineSlot
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 536, in do_optTag_tal
Module zope.tal.talinterpreter, line 521, in do_optTag
Module zope.tal.talinterpreter, line 516, in no_tag
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 861, in do_defineMacro
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 957, in do_defineSlot
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 536, in do_optTag_tal
Module zope.tal.talinterpreter, line 521, in do_optTag
Module zope.tal.talinterpreter, line 516, in no_tag
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 949, in do_defineSlot
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 536, in do_optTag_tal
Module zope.tal.talinterpreter, line 521, in do_optTag
Module zope.tal.talinterpreter, line 516, in no_tag
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 861, in do_defineMacro
Module zope.tal.talinterpreter, line 346, in interpret
Module zope.tal.talinterpreter, line 586, in do_setLocal_tal
Module zope.tales.tales, line 696, in evaluate
URL: file:d:\websites\nipo\plone 3.3.5\buildout-cache\eggs\plone-3.3.5-py2.4.egg\Products\CMFPlone\skins\plone_content\document_view.pt
Line 11, Column 4
Expression: <PathExpr standard:u'here/getText'>
Names:
{'container': <PloneSite at /Plone>,
'context': <ATDocument at /Plone/mission-vision/index_html>,
'default': <object object at 0x0108D528>,
'here': <ATDocument at /Plone/mission-vision/index_html>,
'loop': {},
'nothing': None,
'options': {'args': ()},
'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0x07909300>,
'request': <HTTPRequest, URL=http://localhost:8080/mission-vision/index_html/document_view>,
'root': <Application at >,
'template': <FSPageTemplate at /Plone/document_view used for /Plone/mission-vision/index_html>,
'traverse_subpath': [],
'user': <SpecialUser 'Anonymous User'>}
Module zope.tales.expressions, line 217, in __call__
Module Products.PageTemplates.Expressions, line 163, in _eval
Module Products.PageTemplates.Expressions, line 125, in render
Module Products.Archetypes.ClassGen, line 56, in generatedAccessor
Module wicked.fieldevent, line 29, in render
Module zope.event, line 23, in notify
Module zope.component.event, line 26, in dispatch
Module zope.component._api, line 130, in subscribers
Module zope.component.registry, line 290, in subscribers
Module zope.interface.adapter, line 535, in subscribers
Module wicked.fieldevent, line 16, in notifyFieldEvent
Module zope.component._api, line 101, in getMultiAdapter
Module zope.component._api, line 114, in queryMultiAdapter
Module zope.component.registry, line 206, in queryMultiAdapter
Module zope.interface.adapter, line 482, in queryMultiAdapter
Module wicked.fieldevent.meta, line 78, in field_value
Module Products.Archetypes.Field, line 1394, in get
Module Products.Archetypes.BaseUnit, line 100, in transform
Module Products.PortalTransforms.TransformEngine, line 181, in convertTo
Module Products.PortalTransforms.chain, line 51, in convert
Module Products.PortalTransforms.Transform, line 192, in convert
AttributeError: _v_transform
Thanks in advance!
Try this: go to portal_setup, click import tab, select 'Portal Transforms' profile, checkbox 'PloneTransforms setup', hit 'Import selected steps', take care that 'Include dependencies' is checked, too.
References: http://plone.293351.n2.nabble.com/Re-content-type-icons-missing-in-migrated-site-td2563285.html

anthill.exampletheme on Plone 4.2

I'm trying to install a Plone skin called anthill.exampletheme 0.2 on Plone version 4.2 but it keeps returning the error below. The extension, anthill.skinner 0.8 installed and runs fine by itself but not the example theme. Please help!
Traceback (innermost last):
Module ZPublisher.Publish, line 126, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 46, in call_object
Module Shared.DC.Scripts.Bindings, line 322, in __call__
Module Shared.DC.Scripts.Bindings, line 359, in _bindAndExec
Module Products.CMFCore.FSPageTemplate, line 237, in _exec
Module Products.CMFCore.FSPageTemplate, line 177, in pt_render
Module Products.PageTemplates.PageTemplate, line 79, in pt_render
Module zope.pagetemplate.pagetemplate, line 113, in pt_render
Module zope.tal.talinterpreter, line 271, in __call__
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 888, in do_useMacro
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 533, in do_optTag_tal
Module zope.tal.talinterpreter, line 518, in do_optTag
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 583, in do_setLocal_tal
Module zope.tales.tales, line 696, in evaluate
URL: file:c:\plone42\eggs\anthill.exampletheme-0.2-py2.6.egg\anthill\exampletheme\skins\anthill_exampletheme_custom_templates\main_template.pt
Line 9, Column 0
Expression: <PathExpr standard:u'language'>
Names:
{'container': <PloneSite at /test>,
'context': <PloneSite at /test>,
'default': <object object at 0x00991838>,
'here': <PloneSite at /test>,
'loop': {},
'nothing': None,
'options': {'args': ()},
'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0x08794A20>,
'request': <HTTPRequest, URL=http://localhost:8080/test/portal_skins/index_html>,
'root': <Application at >,
'template': <FSPageTemplate at /test/index_html>,
'traverse_subpath': [],
'user': <PropertiedUser 'admin'>}
Module zope.tales.expressions, line 217, in __call__
Module Products.PageTemplates.Expressions, line 147, in _eval
Module zope.tales.expressions, line 118, in _eval
KeyError: 'language'
According to:
https://dev.plone.org/ticket/10676
anthill.exampletheme's main_template is not Plone 4 compatible. Replace its main_template with a Plone 4 main_template (e.g. from sunburst) and you may get further.

LocationError on Products.Five.viewlet.metaconfigure.DublinCoreViewlet for metatags

I didn't change anything. I just rerun the ./bin/buildout -N and ./bin/instance fg. Then the error occurred. It happen to all my plone buidlout project. I check the Internet, fail to find the solution. Anyone came across this error?
http://localhost:8080/Plone/front-page/document_view
Traceback (innermost last):
Module ZPublisher.Publish, line 126, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 46, in call_object
Module Shared.DC.Scripts.Bindings, line 322, in __call__
Module Shared.DC.Scripts.Bindings, line 359, in _bindAndExec
Module Products.CMFCore.FSPageTemplate, line 240, in _exec
Module Products.CMFCore.FSPageTemplate, line 180, in pt_render
Module Products.PageTemplates.PageTemplate, line 79, in pt_render
Module zope.pagetemplate.pagetemplate, line 132, in pt_render
Module zope.pagetemplate.pagetemplate, line 240, in __call__
Module zope.tal.talinterpreter, line 271, in __call__
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 888, in do_useMacro
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 533, in do_optTag_tal
Module zope.tal.talinterpreter, line 518, in do_optTag
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 852, in do_condition
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 533, in do_optTag_tal
Module zope.tal.talinterpreter, line 518, in do_optTag
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 531, in do_optTag_tal
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 742, in do_insertStructure_tal
Module Products.PageTemplates.Expressions, line 218, in evaluateStructure
Module zope.tales.tales, line 696, in evaluate
- URL: file:/home/ivan/var/buildout-cache/eggs/Products.CMFPlone-4.1.3-py2.6.egg/Products/CMFPlone/skins/plone_templates/main_template.pt
- Line 50, Column 8
- Expression: <StringExpr u'plone.htmlhead'>
- Names:
{'container': <ATDocument at /Plone/front-page>,
'context': <ATDocument at /Plone/front-page>,
'default': <object object at 0x7fab678dfb10>,
'here': <ATDocument at /Plone/front-page>,
'loop': {},
'nothing': None,
'options': {'args': ()},
'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0xa9a0628>,
'request': <HTTPRequest, URL=http://localhost:8080/Plone/front-page/document_view>,
'root': <Application at >,
'template': <FSPageTemplate at /Plone/front-page/document_view>,
'traverse_subpath': [],
'user': <PropertiedUser 'admin'>}
Module zope.contentprovider.tales, line 80, in __call__
Module plone.app.viewletmanager.manager, line 85, in render
Module plone.app.layout.viewlets.common, line 48, in render
Module Products.Five.browser.pagetemplatefile, line 125, in __call__
Module Products.Five.browser.pagetemplatefile, line 59, in __call__
Module zope.pagetemplate.pagetemplate, line 132, in pt_render
Module zope.pagetemplate.pagetemplate, line 240, in __call__
Module zope.tal.talinterpreter, line 271, in __call__
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 819, in do_loop_tal
Module zope.tales.tales, line 682, in setRepeat
Module zope.tales.tales, line 696, in evaluate
- URL: /home/ivan/var/buildout-cache/eggs/plone.app.layout-2.1.12-py2.6.egg/plone/app/layout/viewlets/dublin_core.pt
- Line 1, Column 0
- Expression: <PathExpr standard:u'view/metatags'>
- Names:
{'args': (),
'container': <ATDocument at /Plone/front-page>,
'context': <ATDocument at /Plone/front-page>,
'default': <object object at 0x7fab678dfb10>,
'here': <ATDocument at /Plone/front-page>,
'loop': {},
'nothing': None,
'options': {},
'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0xa227e10>,
'request': <HTTPRequest, URL=http://localhost:8080/Plone/front-page/document_view>,
'root': <Application at >,
'template': <Products.Five.browser.pagetemplatefile.ViewPageTemplateFile object at 0x9c04090>,
'traverse_subpath': [],
'user': <PropertiedUser 'admin'>,
'view': <Products.Five.viewlet.metaconfigure.DublinCoreViewlet object at 0xb12e850>,
'views': <Products.Five.browser.pagetemplatefile.ViewMapper object at 0x8c6a310>}
Module zope.tales.expressions, line 217, in __call__
Module Products.PageTemplates.Expressions, line 147, in _eval
Module zope.tales.expressions, line 124, in _eval
Module Products.PageTemplates.Expressions, line 97, in trustedBoboAwareZopeTraverse
Module zope.traversing.adapters, line 136, in traversePathElement
- __traceback_info__: (<Products.Five.viewlet.metaconfigure.DublinCoreViewlet object at 0xb12e850>, 'metatags')
Module zope.traversing.adapters, line 50, in traverse
- __traceback_info__: (<Products.Five.viewlet.metaconfigure.DublinCoreViewlet object at 0xb12e850>, 'metatags', [])
LocationError: (<Products.Five.viewlet.metaconfigure.DublinCoreViewlet object at 0xb12e850>, 'metatags')
We found why when wrong. I did change something. Ops! I accidentally edited the code in zope.viewlet package.

I can't manage portlets

I Just migrated my portal to the newest version 4.0.7 from 3.3.5
I did a new install and migrate my Data.fs
When i click to manage Portlets i can't view de Add Portlet Combo, and when i click on manage portlets i see this error and the site crashes:
Traceback (innermost last):
Module ZPublisher.Publish, line 127, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 47, in call_object
Module Products.Five.browser.metaconfigure, line 477, in __call__
Module Products.Five.browser.pagetemplatefile, line 126, in __call__
Module Products.Five.browser.pagetemplatefile, line 60, in __call__
Module zope.pagetemplate.pagetemplate, line 113, in pt_render
Module zope.tal.talinterpreter, line 271, in __call__
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 888, in do_useMacro
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 533, in do_optTag_tal
Module zope.tal.talinterpreter, line 518, in do_optTag
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 852, in do_condition
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 533, in do_optTag_tal
Module zope.tal.talinterpreter, line 518, in do_optTag
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 954, in do_defineSlot
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 852, in do_condition
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 954, in do_defineSlot
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 533, in do_optTag_tal
Module zope.tal.talinterpreter, line 518, in do_optTag
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 531, in do_optTag_tal
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 742, in do_insertStructure_tal
Module Products.PageTemplates.Expressions, line 220, in evaluateStructure
Module zope.tales.tales, line 696, in evaluate
- URL: file:/usr/local/Plone/buildout-cache/eggs/Plone-4.0.7-py2.6.egg/Products/CMFPlone/skins/plone_templates/main_template.pt
- Line 95, Column 22
- Expression: <StringExpr u'plone.leftcolumn'>
- Names:
{'args': (),
'container': <PloneSite at /Plone>,
'context': <PloneSite at /Plone>,
'default': <object object at 0x7f2637572ae0>,
'here': <PloneSite at /Plone>,
'loop': {},
'nothing': None,
'options': {},
'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0xa39a730>,
'request': <HTTPRequest, URL=http://192.168.198.39:8080/Plone/##manage-group-portlets>,
'root': <Application at >,
'template': <Products.Five.browser.pagetemplatefile.ViewPageTemplateFile object at 0x7375550>,
'traverse_subpath': [],
'user': <PloneUser 'mlopez'>,
'view': <Products.Five.metaclass.SimpleViewClass from /usr/local/Plone/buildout-cache/eggs/plone.app.portlets-2.0.4-py2.6.egg/plone/app/portlets/browser/templates/manage-group.pt object at 0xa392890>,
'views': <Products.Five.browser.pagetemplatefile.ViewMapper object at 0x9da9f90>}
Module zope.contentprovider.tales, line 80, in __call__
Module plone.app.portlets.browser.editmanager, line 66, in render
Module Products.Five.browser.pagetemplatefile, line 126, in __call__
Module Products.Five.browser.pagetemplatefile, line 60, in __call__
Module zope.pagetemplate.pagetemplate, line 113, in pt_render
Module zope.tal.talinterpreter, line 271, in __call__
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 531, in do_optTag_tal
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 888, in do_useMacro
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 819, in do_loop_tal
Module zope.tales.tales, line 682, in setRepeat
Module zope.tales.tales, line 696, in evaluate
- URL: /usr/local/Plone/buildout-cache/eggs/plone.app.portlets-2.0.4-py2.6.egg/plone/app/portlets/browser/templates/edit-manager-macros.pt
- Line 45, Column 8
- Expression: <PathExpr standard:u'view/portlets'>
- Names:
{'args': (),
'container': <PloneSite at /Plone>,
'context': <PloneSite at /Plone>,
'default': <object object at 0x7f2637572ae0>,
'here': <PloneSite at /Plone>,
'loop': {},
'nothing': None,
'options': {},
'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0xa37c838>,
'request': <HTTPRequest, URL=http://192.168.198.39:8080/Plone/##manage-group-portlets>,
'root': <Application at >,
'template': <Products.Five.browser.pagetemplatefile.ViewPageTemplateFile object at 0x737f510>,
'traverse_subpath': [],
'user': <PloneUser 'mlopez'>,
'view': <plone.app.portlets.browser.editmanager.EditPortletManagerRenderer object at 0xa39b610>,
'views': <Products.Five.browser.pagetemplatefile.ViewMapper object at 0xa39be10>}
Module zope.tales.expressions, line 217, in __call__
Module Products.PageTemplates.Expressions, line 157, in _eval
Module Products.PageTemplates.Expressions, line 119, in render
Module plone.app.portlets.browser.editmanager, line 78, in portlets
Module plone.memoize.view, line 47, in memogetter
Module plone.app.portlets.browser.editmanager, line 171, in _lazyLoadAssignments
Module plone.app.portlets.browser.manage, line 213, in getAssignmentsForManager
Module zope.container.btree, line 88, in __getitem__
KeyError: 'group'
x
There appears to be a corrupted portlet manager in your site; it is missing the "group" category. This doesn't normally happen, though.
You could open the plone.app.portlets.browser.manage module, and insert a PDB debug prompt, to see what manager this is. Look for the plone.app.portlets egg in your bin/instance script to find its path, then open the plone/app/portlets/browser/manage.py that in your favourite text editor. Insert your import pdb; pdb.set_trace() line before line 213, run your plone site in foreground mode (bin/instance fg) and start poking around. manager.__name__ should be interesting, for example, to figure out what manager this is.
You could then try to repair this by inserting an empty category mapper:
from plone.portlets.storage import PortletCategoryMapping
from plone.portlets.constants import GROUP_CATEGORY
column[GROUP_CATEGORY] = PortletCategoryMapping()
You may want to be careful with that, though; there may be other things broken here.

Resources