Skip to content

How to change the order of subscribers? #257

Description

@wesleybl

BUG/PROBLEM REPORT (OR OTHER COMMON ISSUE)

What I did:

In a Plone addon, I registered a subscriber:

  <subscriber for="my.products.contents.mycontent.IMyContent
                              OFS.interfaces.IObjectWillBeRemovedEvent"
                      handler=".handler.myhandler" />

What I expect to happen:

I would like this event of mine to be executed before the subscribers registered by Zope. When I delete an object of mine, the notification occurs:

    notify(ObjectWillBeRemovedEvent(ob, self, id))

In that notification, the event:

  <subscriber
      for=".interfaces.IContentish
           zope.interface.interfaces.IObjectEvent"
      handler=".CMFCatalogAware.handleContentishEvent"
      />

runs before mine. How do I get mine to run sooner?

What actually happened:

Event registered by Zope runs before mine.

What version of Python and Zope/Addons I am using:

Python: 3.8.12
Zope 4.6.3
zope.interface 5.4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions