2017-03-23 4 views
0

테스트중인 Plone 사이트를 삭제하려고합니다. 그러나 삭제할 때 오류가 발생합니다. 콘솔에서 Plone - ComponentLookUpError로 인해 Plone 사이트를 삭제할 수 없습니까?

:

Traceback (innermost last): 
    Module ZPublisher.Publish, line 138, in publish 
    Module ZPublisher.mapply, line 77, in mapply 
    Module ZPublisher.Publish, line 48, in call_object 
    Module OFS.ObjectManager, line 540, in manage_delObjects 
    Module OFS.ObjectManager, line 391, in _delObject 
    Module zope.event, line 31, in notify 
    Module zope.component.event, line 24, in dispatch 
    Module zope.component._api, line 136, in subscribers 
    Module zope.component.registry, line 321, in subscribers 
    Module zope.interface.adapter, line 585, in subscribers 
    Module zope.component.event, line 32, in objectEventNotify 
    Module zope.component._api, line 136, in subscribers 
    Module zope.component.registry, line 321, in subscribers 
    Module zope.interface.adapter, line 585, in subscribers 
    Module OFS.subscribers, line 101, in dispatchObjectWillBeMovedEvent 
    Module zope.container.contained, line 153, in dispatchToSublocations 
    Module zope.component._api, line 136, in subscribers 
    Module zope.component.registry, line 321, in subscribers 
    Module zope.interface.adapter, line 585, in subscribers 
    Module OFS.subscribers, line 101, in dispatchObjectWillBeMovedEvent 
    Module zope.container.contained, line 153, in dispatchToSublocations 
    Module zope.component._api, line 136, in subscribers 
    Module zope.component.registry, line 321, in subscribers 
    Module zope.interface.adapter, line 585, in subscribers 
    Module OFS.subscribers, line 101, in dispatchObjectWillBeMovedEvent 
    Module zope.container.contained, line 153, in dispatchToSublocations 
    Module zope.component._api, line 136, in subscribers 
    Module zope.component.registry, line 321, in subscribers 
    Module zope.interface.adapter, line 585, in subscribers 
    Module OFS.subscribers, line 101, in dispatchObjectWillBeMovedEvent 
    Module zope.container.contained, line 153, in dispatchToSublocations 
    Module zope.component._api, line 136, in subscribers 
    Module zope.component.registry, line 321, in subscribers 
    Module zope.interface.adapter, line 585, in subscribers 
    Module OFS.subscribers, line 101, in dispatchObjectWillBeMovedEvent 
    Module zope.container.contained, line 153, in dispatchToSublocations 
    Module zope.component._api, line 136, in subscribers 
    Module zope.component.registry, line 321, in subscribers 
    Module zope.interface.adapter, line 585, in subscribers 
    Module Products.CMFCore.CMFCatalogAware, line 271, in handleContentishEvent 
    Module Products.CMFCore.CMFCatalogAware, line 76, in unindexObject 
    Module Products.CMFCore.CatalogTool, line 280, in unindexObject 
    Module Products.CMFPlone.CatalogTool, line 354, in uncatalog_object 
    Module Products.ZCatalog.ZCatalog, line 508, in uncatalog_object 
    Module Products.ZCatalog.Catalog, line 383, in uncatalogObject 
    Module Products.PluginIndexes.common.UnIndex, line 286, in unindex_object 
    Module Products.PluginIndexes.UUIDIndex.UUIDIndex, line 98, in removeForwardIndexEntry 
    Module z3c.relationfield.relation, line 79, in __cmp__ 
    Module z3c.relationfield.relation, line 82, in _sort_key 
    Module z3c.relationfield.relation, line 31, in from_path 
    Module plone.app.relationfield.monkey, line 14, in get_from_object 
    Module z3c.relationfield.relation, line 110, in _object 
    Module zope.component._api, line 169, in getUtility 
ComponentLookupError: (<InterfaceClass zope.intid.interfaces.IIntIds>, '') 

페이지는 표시

(<InterfaceClass zope.intid.interfaces.IIntIds>, '') 

I은 ​​이벤트 가입자에 IIntIds를 사용합니까이 문제가 될 수 있다면 아마 궁금.

특정 콘텐츠 형식의 개체가 전환되면 다른 콘텐츠 형식의 다른 개체가 만들어지고 IIntIds 유틸리티를 사용하여 만든 개체의 관계 값을 "가져옵니다". RelationValue는 전환하는 객체의 relatedItem에 추가됩니다. 작성된 오브젝트도 relatedItems를 가지며, 오브젝트의 관계 값을 가져 와서 작성된 오브젝트의 relatedItems에 추가합니다. configure.zcml에서

:

events.py에서
<subscriber 
    for="my.product.myobject.MyObject   
     Products.DCWorkflow.interfaces.IAfterTransitionEvent" 
    handler=".events.myObjectTransitioned" />  

: 나는 질문과 답변 중 하나 언급 가지고 있지 plone.app.relationfield 된 비슷한 질문을 가로 질러왔다

def myObjectTransitioned(obj,event): 

    .... 
    action = event.status['complete'] 
    if action == 'activate': 
     ..... 
     try: 
      new_obj = api.content.create(container=OtherObjs,portal_type='my.object.anotherobject', 
       title=a_concat_title, id=a_concat_title) 
      int_ids = getUtility(IIntIds) 

      obj.relatedItems.append(RelationValue(int_ids.getId(new_obj))) 
      new_obj.relatedItems.append(RelationValue(int_ids.getId(obj))) 

      obj.reindexObject() 
      new_obj.reindexObject() 
     except: 
      print "failed creation"    

또는 plone.app.intId가 설치되어 있어야합니다. 나는 plone.app.relationfield (RelationValue) 및 plone.app.intId (plone.app.intid : 유틸리티 설치)가 있습니다.

기본적으로 to_object를 호출하여 new_obj가 obj (전환 된 객체) 및 visa versa에서 정보를 얻을 수 있도록이 작업을 수행하고 있습니다. 그러나, 나는이 오류를 일으키는 것 같아요 및 obj 정보를 가져 오는 new_obj에 대한 다시 참조를 사용해야합니까?

+0

충분한 정보를 제공하지 않거나 중복 된 질문 인 경우 사과드립니다.하지만 유감스럽게도 분실되었습니다. –

+1

우리 포럼 (https://community.plone.org) (더 많은 안구)에 게시 질문을 게시하는 것이 더 나을지 모르지만 포럼에 귀하의 질문에 대한 링크를 게시합니다. –

+1

불행히도 도움이되는 정보가 충분하지 않습니다. 사이트를 삭제하려고 할 때 호출되는 이벤트 구독자가 있다고 생각합니다. 문제가되는 이벤트를 찾아 ZCML 등록을 건너 뛰십시오. 인스턴스를 다시 시작한 후 다시 시도하십시오. – hvelarde

답변

2

기본적으로 사이트를 삭제하지 못하게하는 이유는 매번 트리거되는 이벤트 (귀찮은 코드를 실행하는 이벤트) 때문입니다. 이 문제를 방지하기 위해, 나는 일을 제안 할 수 있습니다 다음과 같은 : 일반적으로

$ cd {buildout-dir} 
$ bin/zopepy 
> from transaction import commit 
> app._delObject('Plone', suppress_events=True) 
> commit() 

는 예를 들어도 업데이트에서 portal_catalog을 방지하고 다른 쪽을 야기이 같은 플론 (Plone) 사이트 내에서 개체에 대해이 작업을 수행하지 않는 것이 좋습니다 효과. 그러나 사이트 전체를 삭제하면 문제가되지 않습니다.

+0

응답 해 주셔서 감사합니다. 시간 내 주셔서 감사합니다. 관계 가치를 깨는 것과 관련하여 다른 제품에 다른 문제가 있음을 알게되었습니다. 하지만 공유해 주셔서 감사합니다. 저를위한 data.fs 삭제에 그것의 편리한 대안. –