3.x 마이그레이션으로 Plone 2.5x 후에 KSS_Generic_Macros 문제를 어떻게 수정합니까?

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

  •  22-07-2019
  •  | 
  •  

문제

여러 조회에서 아래 오류가 발생합니다. 여기에 설명 된 내용과 동일하게 보입니다. 다른 KSS_GENERIC_MACROS 게시하다. 답이 제공됩니다.이것은 2.5-> 3.0 마이그레이션 프로세스가 PLONE_KSS 레이어를 소수의 커스텀 스킨에 추가하지 못하는 것에 의해 발생했습니다. 내가 들어가서 그 스킨에 손으로 plone_ks를 추가했을 때, 그것은 이것을 고쳤다."

이것은 매우 도움이됩니다. plone_ks를 추가하는 위치에 대한 코드 샘플 또는 실제 포인터는 훨씬 쉽게 해결할 수 있습니다.

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 Default"피부는 다음과 같이 보일 것입니다.

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

다음 파이썬 스크립트로이를 자동화 할 수 있습니다.

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