You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now, add collective.elasticsearch to the eggs section. Create a Plone Site. Delete it in the ZMI. You get the traceback:
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 539, in manage_delObjects
Module OFS.ObjectManager, line 390, 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 Products.CMFCore.CMFCatalogAware, line 271, in handleContentishEvent
Module Products.Archetypes.CatalogMultiplex, line 49, in unindexObject
Module collective.elasticsearch.patches, line 15, in uncatalog_object (https://github.com/collective/collective.elasticsearch/blob/3.0.3/collective/elasticsearch/patches.py#L15)
Module collective.elasticsearch.es, line 219, in uncatalog_object (https://github.com/collective/collective.elasticsearch/blob/3.0.3/collective/elasticsearch/es.py#L219)
Module plone.api.content, line 2, in get
Module plone.api.validation, line 112, in wrapped
Module plone.api.content, line 2, in get
Module plone.api.validation, line 149, in wrapped
Module plone.api.content, line 151, in get
Module plone.api.portal, line 82, in get
CannotGetPortalError: Unable to get the portal object. More info on http://docs.plone.org/develop/plone.api/docs/api/exceptions.html#plone.api.exc.CannotGetPortalError
2019-05-21 14:18:38 INFO SignalHandler Caught signal SIGINT
If you remove collective.elasticsearch from the eggs, you can delete the Plone Site again.
The text was updated successfully, but these errors were encountered:
Had the same issue. The source of the problem that patched methods from patches.py are called as soon as collective.elasticsearch is present in the buildout.
This is not a problem with regular events, it is not an issue, since there is a check within ElasticSearchCatalog object for self.enabled.
Plone Site delete is a special case though, and results above error.
Quick fix for this exact issue:
def uncatalog_object(self, uid, obj=None, *args, **kwargs):
+ from collective.elasticsearch.interfaces import IElasticSearchLayer+ if not IElasticSearchLayer.providedBy(self.REQUEST):+ return self.uncatalog_object
es = ElasticSearchCatalog(self)
return es.uncatalog_object(uid, obj, *args, **kwargs)
Probably all patched methods should be layer aware.
How to simulate:
Create a minimalplone 4 instance.
https://github.com/collective/minimalplone4
Create a Plone Site. Delete It in the ZMI.
Now, add collective.elasticsearch to the
eggs
section. Create a Plone Site. Delete it in the ZMI. You get the traceback:If you remove collective.elasticsearch from the eggs, you can delete the Plone Site again.
The text was updated successfully, but these errors were encountered: