Commit e7e1676e authored by Zachery Bir's avatar Zachery Bir

Brought forward from the Zope 2.7 branch:

If the new value is _marker (basically, if we index with a value of
None), we should also remove the object from our _unindex
parent 38328ef3
......@@ -26,6 +26,8 @@ from BTrees.OIBTree import OIBTree
from DateTime.DateTime import DateTime
from Globals import DTMLFile
from OFS.PropertyManager import PropertyManager
from ZODB.POSException import ConflictError
from zLOG import LOG, ERROR
from zope.interface import implements
from Products.PluginIndexes.common import safe_callable
......@@ -135,6 +137,15 @@ class DateIndex(UnIndex, PropertyManager):
if ConvertedDate != oldConvertedDate:
if oldConvertedDate is not _marker:
self.removeForwardIndexEntry(oldConvertedDate, documentId)
if ConvertedDate is _marker:
try:
del self._unindex[documentId]
except ConflictError:
raise
except:
LOG('UnIndex', ERROR,
'Should not happen: oldDatum was there, now its not,'
'for document with id %s' % documentId)
if ConvertedDate is not _marker:
self.insertForwardIndexEntry( ConvertedDate, documentId )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment