我无法管理portlet

时间:2011-07-19 14:02:30

标签: plone

我刚刚将门户网站从3.3.5迁移到最新版本4.0.7 我做了一个新安装并迁移了我的Data.fs

当我点击管理Portlets时,我无法查看de Add Portlet Combo,当我点击manage portlets时,我看到此错误并且网站崩溃:

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

1 个答案:

答案 0 :(得分:2)

您的网站中似乎存在损坏的portlet管理器;它缺少“组”类别。但这通常不会发生。

您可以打开plone.app.portlets.browser.manage模块,并插入PDB调试提示,以查看这是什么经理。在bin / instance脚本中查找plone.app.portlets egg以查找其路径,然后在您喜欢的文本编辑器中打开plone/app/portlets/browser/manage.py。在第213行之前插入import pdb; pdb.set_trace()行,以前台模式(bin/instance fg)运行您的plone网站并开始探索。例如,manager.__name__应该很有趣,以弄清楚这是什么经理。

然后,您可以尝试通过插入空类别映射器来修复此问题:

from plone.portlets.storage import PortletCategoryMapping
from plone.portlets.constants import GROUP_CATEGORY
column[GROUP_CATEGORY] = PortletCategoryMapping()

你可能要小心这一点;可能还有其他事情在这里打破。