Skip to content

Commit

Permalink
Avoid extra ObjectModifiedEvent on revert
Browse files Browse the repository at this point in the history
  • Loading branch information
davisagli committed Sep 19, 2022
1 parent fc5146f commit 13b7ef6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 1 addition & 3 deletions Products/CMFEditions/CopyModifyMergeRepositoryTool.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@
from Products.CMFEditions.utilities import wrap
from Products.CMFEditions.VersionPolicies import VersionPolicy
from ZODB.broken import Broken
from zope.event import notify
from zope.interface import implementer
from zope.lifecycleevent import ObjectModifiedEvent

import logging
import time
Expand Down Expand Up @@ -670,8 +668,8 @@ def _fixupCatalogData(self, obj):
"""Reindex the object, otherwise the catalog will certainly
be out of sync."""
portal_catalog = getToolByName(self, "portal_catalog")
# Note: this notifies an ObjectModifiedEvent as a side effect.
portal_catalog.indexObject(obj)
notify(ObjectModifiedEvent(obj))
# XXX: In theory we should probably be emitting IObjectMoved event
# here as it is a possible consequence of a revert.
# Perhaps in our current meager z2 existence we should do
Expand Down
1 change: 1 addition & 0 deletions news/90.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Only fire ObjectModifiedEvent once when an item is reverted to an old version. [davisagli]

0 comments on commit 13b7ef6

Please sign in to comment.