[CMF-checkins] SVN: CMF/branches/1.5/C - added missing 'pghandler'
argument (http://www.zope.org/Collectors/CMF/379)
Yvo Schubbe
y.2005- at wcm-solutions.de
Sat Sep 3 09:40:18 EDT 2005
Log message for revision 38289:
- added missing 'pghandler' argument (http://www.zope.org/Collectors/CMF/379)
Changed:
U CMF/branches/1.5/CHANGES.txt
U CMF/branches/1.5/CMFCore/CatalogTool.py
U CMF/branches/1.5/CMFCore/tests/test_CatalogTool.py
-=-
Modified: CMF/branches/1.5/CHANGES.txt
===================================================================
--- CMF/branches/1.5/CHANGES.txt 2005-09-03 09:11:12 UTC (rev 38288)
+++ CMF/branches/1.5/CHANGES.txt 2005-09-03 13:40:17 UTC (rev 38289)
@@ -1,3 +1,12 @@
+CMF 1.5.4 (unreleased)
+
+ Bug Fixes
+
+ - CatalogTool: Made sure the catalog_object method works with Zope 2.8.
+ The new 'pghandler' argument was missing. This broke at least the
+ refreshCatalog method used by 'Update Catalog'.
+ (http://www.zope.org/Collectors/CMF/379)
+
CMF 1.5.4-beta (2005/08/28)
Bug Fixes
Modified: CMF/branches/1.5/CMFCore/CatalogTool.py
===================================================================
--- CMF/branches/1.5/CMFCore/CatalogTool.py 2005-09-03 09:11:12 UTC (rev 38288)
+++ CMF/branches/1.5/CMFCore/CatalogTool.py 2005-09-03 13:40:17 UTC (rev 38289)
@@ -300,7 +300,8 @@
manage_catalogFind = DTMLFile( 'catalogFind', _dtmldir )
- def catalog_object(self, obj, uid, idxs=None, update_metadata=1):
+ def catalog_object(self, obj, uid=None, idxs=None, update_metadata=1,
+ pghandler=None):
# Wraps the object with workflow and accessibility
# information just before cataloging.
wftool = getToolByName(self, 'portal_workflow', None)
@@ -309,7 +310,12 @@
else:
vars = {}
w = IndexableObjectWrapper(vars, obj)
- ZCatalog.catalog_object(self, w, uid, idxs, update_metadata)
+ try:
+ ZCatalog.catalog_object(self, w, uid, idxs, update_metadata,
+ pghandler)
+ except TypeError:
+ # BBB: for Zope 2.7
+ ZCatalog.catalog_object(self, w, uid, idxs, update_metadata)
security.declarePrivate('indexObject')
def indexObject(self, object):
Modified: CMF/branches/1.5/CMFCore/tests/test_CatalogTool.py
===================================================================
--- CMF/branches/1.5/CMFCore/tests/test_CatalogTool.py 2005-09-03 09:11:12 UTC (rev 38288)
+++ CMF/branches/1.5/CMFCore/tests/test_CatalogTool.py 2005-09-03 13:40:17 UTC (rev 38289)
@@ -27,6 +27,7 @@
from DateTime import DateTime
from Products.CMFCore.tests.base.dummy import DummyContent
+from Products.CMFCore.tests.base.dummy import DummySite
from Products.CMFCore.tests.base.security import OmnipotentUser
from Products.CMFCore.tests.base.security import UserWithRoles
from Products.CMFCore.tests.base.testcase import SecurityTest
@@ -95,7 +96,7 @@
user = OmnipotentUser().__of__(self.root)
newSecurityManager(None, user)
- def test_processActions( self ):
+ def test_processActions(self):
"""
Tracker #405: CatalogTool doesn't accept optional third
argument, 'idxs', to 'catalog_object'.
@@ -300,11 +301,25 @@
convert(kw)
self.assertEqual(kw, {'expires': {'query': (5,7), 'range': 'min:max'}})
+ def test_refreshCatalog(self):
+ site = DummySite('site').__of__(self.root)
+ site._setObject('dummy', DummyContent(catalog=1))
+ site._setObject('portal_catalog', self._makeOne())
+ ctool = site.portal_catalog
+ ctool.catalog_object(site.dummy, '/dummy')
+ self.assertEqual(1, len(ctool._catalog.searchResults()))
+ ctool.refreshCatalog(clear=1)
+ self.assertEqual(1, len(ctool._catalog.searchResults()),
+ 'CMF Collector issue #379 (\'Update Catalog\' '
+ 'fails): %s entries after refreshCatalog'
+ % (len(ctool._catalog.searchResults()),))
+
+
def test_suite():
return TestSuite((
- makeSuite( IndexableObjectWrapperTests ),
- makeSuite( CatalogToolTests ),
+ makeSuite(IndexableObjectWrapperTests),
+ makeSuite(CatalogToolTests),
))
if __name__ == '__main__':
More information about the CMF-checkins
mailing list