Skip to content

Commit

Permalink
Merge pull request #91 from plone/fix-extra-version-on-revert
Browse files Browse the repository at this point in the history
Avoid extra ObjectModifiedEvent on revert
  • Loading branch information
davisagli authored Sep 19, 2022
2 parents fc5146f + 13b7ef6 commit 68c5595
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 68c5595

Please sign in to comment.