1

我正在尝试自定义 plone.global.sections (webcouturier.dropdownmenu.browser.interfaces.IDropdownSpecific),即使当我点击自定义按钮时我没有对 pt 文件进行任何更改,我也会收到此错误:GetTabObject 未定义:

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 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:/usr/local/Plone/buildout-cache/eggs/plonetheme.sunburst-1.1.5-py2.6.egg/plonetheme/sunburst/skins/sunburst_templates/main_template.pt
   - Line 68, Column 12
   - Expression: <StringExpr u'plone.portaltop'>
   - Names:
      {'container': <PloneSite at /asianam/asianam>,
       'context': <ATDocument at /asianam/asianam/front-page>,
       'default': <object object at 0x2b93133d8b20>,
       'here': <ATDocument at /asianam/asianam/front-page>,
       'loop': {},
       'nothing': None,
       'options': {'args': ()},
       'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0x1ff0f578>,
       'request': <HTTPRequest, URL=http://plone4d.sscnet.ucla.edu:8080/asianam/asianam/front-page/hide_title>,
       'root': <Application at >,
       'template': <ZopePageTemplate at /asianam/asianam/hide_title used for /asianam/asianam/front-page>,
       'traverse_subpath': [],
       'user': <PropertiedUser 'elaine'>}
  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 zope.browserpage.simpleviewclass, line 44, in __call__
  Module Products.Five.browser.pagetemplatefile, line 125, in __call__
  Module Products.Five.browser.pagetemplatefile, line 59, 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 742, in do_insertStructure_tal
  Module Products.PageTemplates.Expressions, line 218, in evaluateStructure
  Module zope.tales.tales, line 696, in evaluate
   - URL: /usr/local/Plone/buildout-cache/eggs/plone.app.layout-2.1.12-py2.6.egg/plone/app/layout/viewlets/portal_header.pt
   - Line 2, Column 4
   - Expression: <StringExpr u'plone.portalheader'>
   - Names:
      {'args': (),
       'container': <ATDocument at /asianam/asianam/front-page>,
       'context': <ATDocument at /asianam/asianam/front-page>,
       'default': <object object at 0x2b93133d8b20>,
       'here': <ATDocument at /asianam/asianam/front-page>,
       'loop': {},
       'nothing': None,
       'options': {},
       'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0x23374f70>,
       'request': <HTTPRequest, URL=http://plone4d.sscnet.ucla.edu:8080/asianam/asianam/front-page/hide_title>,
       'root': <Application at >,
       'template': <Products.Five.browser.pagetemplatefile.ViewPageTemplateFile object at 0x110a3c10>,
       'traverse_subpath': [],
       'user': <PropertiedUser 'elaine'>,
       'view': <Products.Five.viewlet.viewlet.SimpleViewletClass from /usr/local/Plone/buildout-cache/eggs/plone.app.layout-2.1.12-py2.6.egg/plone/app/layout/viewlets/portal_header.pt object at 0x2333cd90>,
       'views': <Products.Five.browser.pagetemplatefile.ViewMapper object at 0x21d56350>}
  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 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 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 821, in do_loop_tal
  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: /asianam/asianam/portal_view_customizations/zope.interface.interface-plone.global_sections
   - Line 9, Column 9
   - Expression: <PythonExpr view.getTabObject(tabUrl = tab['url'], tabPath = tab.get('path'))>
   - Names:
      {'container': <ViewTemplateContainer at /asianam/asianam/portal_view_customizations>,
       'context': <ATDocument at /asianam/asianam/front-page>,
       'default': <object object at 0x2b93133d8b20>,
       'here': <ATDocument at /asianam/asianam/front-page>,
       'loop': {u'tab': <Products.PageTemplates.Expressions.PathIterator object at 0x23350310>},
       'nothing': None,
       'options': {'args': ()},
       'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0x23351af8>,
       'request': <HTTPRequest, URL=http://plone4d.sscnet.ucla.edu:8080/asianam/asianam/front-page/hide_title>,
       'root': <Application at >,
       'template': <TTWViewTemplate at /asianam/asianam/portal_view_customizations/zope.interface.interface-plone.global_sections used for /asianam/asianam/front-page>,
       'user': <PropertiedUser 'elaine'>,
       'view': <five.customerize.zpt.TTWViewlet object at 0x23350050>}
  Module Products.PageTemplates.ZRPythonExpr, line 48, in __call__
   - __traceback_info__: view.getTabObject(tabUrl = tab['url'], tabPath = tab.get('path'))
  Module PythonExpr, line 1, in <expression>
AttributeError: 'TTWViewlet' object has no attribute 'getTabObject'

我读过main_template.ptPlone 4.1 中不再使用全局定义(),但我不知道如何将定义添加到 pt 文件中。任何帮助表示赞赏。

4

1 回答 1

1

这只是我的开发服务器上的一个问题,适用于本地主机和产品,去图

于 2012-08-09T21:30:49.363 回答