在Plone 2.5x到Plone 3.x的迁移之后,如何纠正kss\u通用\u宏问题?

在Plone 2.5x到Plone 3.x的迁移之后,如何纠正kss\u通用\u宏问题?,plone,plone-3.x,Plone,Plone 3.x,我在以下几个视图中得到了错误。这似乎与本文描述的内容相同。答案是“这是由于2.5->3.0迁移过程未能将plone_kss层添加到我们的一些自定义皮肤中造成的。当我进入并手动将plone_kss添加到这些皮肤中时,它修复了这一问题。” 这是非常有用的。一个代码示例或一个真正的指向您在何处添加plone_kss的指针将使这个问题更容易解决 2009-06-24 15:24:28 ERROR Zope.SiteErrorLog 1245871468.060.103936823493 https://

我在以下几个视图中得到了错误。这似乎与本文描述的内容相同。答案是“这是由于2.5->3.0迁移过程未能将plone_kss层添加到我们的一些自定义皮肤中造成的。当我进入并手动将plone_kss添加到这些皮肤中时,它修复了这一问题。”

这是非常有用的。一个代码示例或一个真正的指向您在何处添加plone_kss的指针将使这个问题更容易解决

2009-06-24 15:24:28 ERROR Zope.SiteErrorLog 1245871468.060.103936823493 https://nasascience.on.my.mac/humanator-folder/what-is-six-plus-3/base_view
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.CacheSetup.patch_cmf, line 29, in FSPT_pt_render
  Module Products.CacheSetup.patch_utils, line 9, in call_pattern
  Module Products.CMFCore.FSPageTemplate, line 155, in pt_render
  Module Products.CacheSetup.patch_cmf, line 77, in PT_pt_render
  Module Products.CacheSetup.patch_utils, line 9, in call_pattern
  Module Products.PageTemplates.PageTemplate, line 98, in pt_render
  Module zope.pagetemplate.pagetemplate, line 117, in pt_render
   - Warning: Macro expansion failed
   - Warning: exceptions.KeyError: 'macro'
  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 536, in do_optTag_tal
  Module zope.tal.talinterpreter, line 525, in do_optTag
  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 536, in do_optTag_tal
  Module zope.tal.talinterpreter, line 525, in do_optTag
  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 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 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 870, in do_useMacro
  Module zope.tales.tales, line 696, in evaluate
   - URL: file:/Users/danny/projects/schwa/2.1.0a/trunk/eggs/Products.Archetypes-1.5.10-py2.4.egg/Products/Archetypes/skins/archetypes/base.pt
   - Line 22, Column 10
   - Expression: <PathExpr standard:u'here/kss_generic_macros/macros/generic_title_view'>
   - Names:
      {'container': <PloneSite at /msrd>,
       'context': <Humanatorquestion at /msrd/humanator-folder/what-is-six-plus-3>,
       'default': <object object at 0x1bf528>,
       'here': <Humanatorquestion at /msrd/humanator-folder/what-is-six-plus-3>,
       'loop': {},
       'nothing': None,
       'options': {'args': ()},
       'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0x9ea75f8>,
       'request': <HTTPRequest, URL=https://nasascience.on.my.mac/humanator-folder/what-is-six-plus-3/base_view>,
       'root': <Application at >,
       'template': <FSPageTemplate at /msrd/base_view used for /msrd/humanator-folder/what-is-six-plus-3>,
       'traverse_subpath': [],
       'user': <PloneUser 'admin'>}
  Module zope.tales.expressions, line 217, in __call__
  Module Products.PageTemplates.Expressions, line 155, in _eval
  Module zope.tales.expressions, line 124, in _eval
  Module Products.PageTemplates.Expressions, line 82, in boboAwareZopeTraverse
  Module OFS.Traversable, line 301, in restrictedTraverse
  Module OFS.Traversable, line 269, in unrestrictedTraverse
   - __traceback_info__: ([], 'kss_generic_macros')
AttributeError: kss_generic_macros
2009-06-24 15:24:28错误Zope.SiteErrorLog 1245871468.060.103936823493https://nasascience.on.my.mac/humanator-folder/what-is-six-plus-3/base_view
回溯(最里面的最后一个):
模块ZPublisher.Publish,第119行,在Publish中
模块ZPublisher.mapply,第88行,在mapply中
模块ZPublisher.Publish,第42行,在call_对象中
模块Shared.DC.Scripts.Bindings,第313行,在调用中__
模块Shared.DC.Scripts.Bindings,第350行,在_bindAndExec中
模块Products.CMFCore.FSPageTemplate,第216行,in_exec
模块Products.CacheSetup.patch_cmf,第29行,在FSPT_pt_渲染中
模块Products.CacheSetup.patch_utils,第9行,调用模式
模块Products.CMFCore.FSPageTemplate,第155行,在pt_渲染中
模块Products.CacheSetup.patch_cmf,第77行,在PT_PT_渲染中
模块Products.CacheSetup.patch_utils,第9行,调用模式
模块Products.PageTemplates.PageTemplate,第98行,在pt_render中
模块zope.pagetemplate.pagetemplate,第117行,在pt_渲染中
-警告:宏扩展失败
-警告:exceptions.KeyError:“宏”
模块zope.tal.t interpreter,第271行,输入调用__
模块zope.tal.t解释程序第346行
do_useMacro中的模块zope.tal.tInterpreter,第891行
模块zope.tal.t解释程序第346行
do_optTag_tal中模块zope.tal.tInterpreter,第536行
do_optTag中模块zope.tal.tInterpreter,第521行
模块zope.tal.tInterpreter,第516行,无标签
模块zope.tal.t解释程序第346行
do_optTag_tal中模块zope.tal.tInterpreter,第536行
do_optTag中模块zope.tal.tInterpreter,第525行
模块zope.tal.t解释程序第346行
do_defineSlot中模块zope.tal.tInterpreter,第957行
模块zope.tal.t解释程序第346行
do_optTag_tal中模块zope.tal.tInterpreter,第536行
do_optTag中模块zope.tal.tInterpreter,第521行
模块zope.tal.tInterpreter,第516行,无标签
模块zope.tal.t解释程序第346行
do_defineMacro中模块zope.tal.tInterpreter,第861行
模块zope.tal.t解释程序第346行
do_defineSlot中模块zope.tal.tInterpreter,第957行
模块zope.tal.t解释程序第346行
do_optTag_tal中模块zope.tal.tInterpreter,第536行
do_optTag中模块zope.tal.tInterpreter,第521行
模块zope.tal.tInterpreter,第516行,无标签
模块zope.tal.t解释程序第346行
do_optTag_tal中模块zope.tal.tInterpreter,第536行
do_optTag中模块zope.tal.tInterpreter,第525行
模块zope.tal.t解释程序第346行
模块zope.tal.t Interpreter,第949行,在do_defineSlot中
模块zope.tal.t解释程序第346行
do_optTag_tal中模块zope.tal.tInterpreter,第536行
do_optTag中模块zope.tal.tInterpreter,第521行
模块zope.tal.tInterpreter,第516行,无标签
模块zope.tal.t解释程序第346行
do_defineMacro中模块zope.tal.tInterpreter,第861行
模块zope.tal.t解释程序第346行
do_optTag_tal中模块zope.tal.tInterpreter,第536行
do_optTag中模块zope.tal.tInterpreter,第521行
模块zope.tal.tInterpreter,第516行,无标签
模块zope.tal.t解释程序第346行
do_useMacro中的模块zope.tal.tInterpreter,第891行
模块zope.tal.t解释程序第346行
do_optTag_tal中模块zope.tal.tInterpreter,第536行
do_optTag中模块zope.tal.tInterpreter,第521行
模块zope.tal.tInterpreter,第516行,无标签
模块zope.tal.t解释程序第346行
do_useMacro中的模块zope.tal.tInterpreter,第870行
模块zope.tales.tales,第696行,在评估中
-URL:file:/Users/danny/projects/schwa/2.1.0a/trunk/eggs/Products.Archetypes-1.5.10-py2.4.egg/Products/Archetypes/skins/Archetypes/base.pt
-第22行第10列
-表达方式:
-姓名:
{'container':,
“上下文”:,
“默认值”:,
“这里”:,
'循环':{},
“没有”:没有,
'options':{'args':()},
“重复”:,
“请求”:,
“根”:,
“模板”:,
“遍历子路径”:[],
“用户”:}
模块zope.tales.expressions,第217行,输入调用__
模块Products.PageTemplates.Expressions,第155行,评估中
模块zope.tales.expressions,第124行,评估
模块Products.PageTemplates.Expressions,第82行,BoboawareZopeTravel格式
可穿越模块,第301行,受限行程
可穿越模块,第269行,无限制穿越
-_uu回溯_u信息:([],“kss_通用_宏”)
AttributeError:kss\u通用\u宏

登录ZMI,然后转到门户网站工具。现在单击“属性”选项卡。“Plone默认”外观应如下所示:

custom
cmfeditions_views
CMFEditions
ChangeSet
kupu_plone
kupu
kupu_tests
archetypes
archetypes_kss
mimetypes_icons
plone_kss
ATContentTypes
ATReferenceBrowserWidget
ResourceRegistries
PasswordReset
gruf
plone_ecmascript
plone_wysiwyg
plone_prefs
plone_portlets
plone_templates
plone_styles
plone_form_scripts
plone_scripts
plone_forms
plone_images
plone_content
plone_login
plone_deprecated
plone_3rdParty
cmf_legacy

如果您缺少其中任何一项,则需要将其添加进去。这应该可以解决问题。

您缺少皮肤中的
plone\u kss
层。转到ZMI(通过站点设置或向Plone主页添加/管理),找到portal_皮肤工具,并在“属性”选项卡中检查皮肤层。确保
plone\u kss
层列在自定义层之前,并且您应该设置为go

将来,您可以使用像find这样的命令行工具来查找缺少的皮肤方法;我发现
$ find parts/plone -name kss_generic_macros.*
parts/plone/CMFPlone/skins/plone_kss/kss_generic_macros.pt
from Products.CMFCore.utils import getToolByName
layer = 'plone_kss'
skins = getToolByName(context, 'portal_skins')
for name in skins.getSkinSelections():
    path = skins.getSkinPath(name)
    path = [i.strip() for i in path.split(',')]
    if layer not in path:
        try:
            path.insert(path.index('custom') + 1, layer)
        except ValueError:
            path.append(layer)
        skins.addSkinSelection(name, ','.join(path))