从 Plone 2.5x 迁移到 Plone 3.x 后,如何纠正 kss_generic_macros 问题?
我在几个视图中收到以下错误。 这似乎与其他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
I get the error below on several views. Which seems identical to what is described here in this other kss_generic_macros post. An answer is supplied, which is "This was caused by the 2.5->3.0 migration process failing to add the plone_kss layer to a handful of our custom skins. When I went in and added plone_kss by hand to those skins, it fixed this."
This is only so helpful. A code sample or a real pointer as to where you add plone_kss would make this much easier to solve.
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的皮肤中缺少
plone_kss
层。 转到 ZMI(通过站点设置或将 /manage 添加到您的 Plone 主页),找到 Portal_skins 工具,然后在属性选项卡中检查您的皮肤层。 确保plone_kss
图层列在自定义图层之前,您就可以开始使用了。以后可以使用find之类的命令行工具来定位缺失的皮肤方法; 我通过使用以下命令在构建中找到了这个:
您可以使用以下 Python 脚本自动执行此操作:
此脚本循环遍历皮肤工具中的所有皮肤,并将
plone_kss
插入其中任何一个哪里缺失了; 要么紧接在custom
层之后,要么在最后(如果不存在custom
层)。您希望您的
自定义
层位于第一个的原因是该自定义层(没有双关语)保存了皮肤资源的自定义版本。 如果您要通过 ZMI 从portal_kss
层自定义资产,则自定义版本将放置在custom
层中。 由于皮肤查找规则将从上到下遍历图层堆栈,因此您需要确保在较低层中的原始版本之前找到custom
图层中的自定义版本。You are missing the
plone_kss
layer in your skins. Go to the ZMI (via site setup or by adding /manage to your Plone homepage), find the portal_skins tool, and check your skin layers in the properties tab. Make sure theplone_kss
layer is listed before the custom layer and you should be set to go.In future, you can use a command line tool like find to locate missing skin methods; I found this one in a buildout by using the following command:
You can automate this with the following Python Script:
This script loops over all skins in the skins tool, and will insert
plone_kss
into any one of them where it is missing; either just after thecustom
layer, or at the end if there is nocustom
layer present.The reason you want your
custom
layer to be first is that this layer by custom (no pun intended) holds customized versions of skin assets. If you were to customize an asset from theportal_kss
layer through the ZMI then the customized version will be put in thecustom
layer. Because skin lookup rules will look through the layer stack top-to-bottom, you want to make sure your customized versions in thecustom
layer are found before the originals in the lower layers.登录 ZMI,然后转到 Portal_skins 工具。 现在单击“属性”选项卡。 “Plone Default”皮肤应该看起来像这样:
如果您缺少其中任何一个,您需要添加它们。这应该可以解决问题。
Log into the ZMI then go to the portal_skins tool. Now click on the "properties" tab. The "Plone Default" skin should look something like this:
If you are missing any of those you'll need to add them in. That should solve the issue.