后一Plone2.5倍以Plone3.x迁移,我怎么正确的kss_generic_macros问题?

StackOverflow https://stackoverflow.com/questions/1040520

  •  22-07-2019
  •  | 
  •  

我得到的错误之下在几个意见。这似乎完全相同是什么这里所描述的在这 其他kss_generic_macros 员额。一个答复提供,这是"这是由于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
有帮助吗?

解决方案

登录到ZMI然后去portal_skins工具。现在点击"性质"标签。在"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_kss 层在你的皮肤。去ZMI(通过网站设置或加入/管理你的Plone的网页),找到portal_skins工具,并检查你的皮肤层在性质标签。确保 plone_kss 层之前列出的定义层和你应该设置去。

在未来,您可以使用命令行的工具,如找到找到失踪的皮肤方法;我发现这个人在附加件通过使用以下命令:

$ find parts/plone -name kss_generic_macros.*
parts/plone/CMFPlone/skins/plone_kss/kss_generic_macros.pt

你可以自动化,这与以下Python脚本:

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))

这个脚本的循环所有皮的皮肤工具,并将插入 plone_kss 变成他们中的任何一个在那里是缺失;无论是之后 custom 层,或者结束时,如果没有 custom 层的存在。

因为你想你的 custom 层将第一个是,这一层通过定义(没有刻意的双关)拥有定制版本的皮肤的资产。如果你是来自一个资产 portal_kss 层通过ZMI随后的定制版本将在 custom 层。由于皮肤的查阅规则将通过看层堆上到底,你想确保你的定制版本中的 custom 层被发现之前原件的较低层。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top