From: Andrew M. <svn...@pl...> - 2010-03-19 18:24:41
|
Author: amleczko Date: Fri Mar 19 18:24:34 2010 New Revision: 35402 Modified: Plone/branches/3.3/Products/CMFPlone/CatalogTool.py Plone/branches/3.3/Products/CMFPlone/tests/testCatalogTool.py Plone/branches/3.3/docs/NEWS.txt Log: 'Find and Catalog' works again. getIcon method in PortalCatalog checks for proper Interface. This fix #8235 Modified: Plone/branches/3.3/Products/CMFPlone/CatalogTool.py ============================================================================== --- Plone/branches/3.3/Products/CMFPlone/CatalogTool.py (original) +++ Plone/branches/3.3/Products/CMFPlone/CatalogTool.py Fri Mar 19 18:24:34 2010 @@ -19,6 +19,7 @@ from BTrees.Length import Length from Products.CMFCore.interfaces import ISiteRoot +from Products.CMFCore.interfaces import ITypeInformation from Products.CMFCore.utils import _getAuthenticatedUser from Products.CMFCore.utils import _checkPermission from Products.CMFCore.utils import getToolByName @@ -371,7 +372,11 @@ @indexer(Interface) def getIcon(obj): """Make sure we index icon relative to portal""" - return obj.getIcon(True) + if ITypeInformation.providedBy(obj): + return obj.getIcon() + else: + return obj.getIcon(True) + class CatalogTool(PloneBaseTool, BaseTool): Modified: Plone/branches/3.3/Products/CMFPlone/tests/testCatalogTool.py ============================================================================== --- Plone/branches/3.3/Products/CMFPlone/tests/testCatalogTool.py (original) +++ Plone/branches/3.3/Products/CMFPlone/tests/testCatalogTool.py Fri Mar 19 18:24:34 2010 @@ -334,6 +334,18 @@ self.assertEquals(len(self.catalog(modified=DateTime(0))), 1) + def testCatalogFoundItems(self): + #First clear the catalog + self.catalog.manage_catalogClear() + #prepare request + request = self.portal.REQUEST + response = request.RESPONSE + request.PARENTS = ['',self.portal] + #Then try to Find and Catalog + self.catalog.manage_catalogFoundItems(request, response, '', '') + self.assertNotEqual(len(self.catalog()), 0) + + class TestCatalogSearching(PloneTestCase.PloneTestCase): def afterSetUp(self): Modified: Plone/branches/3.3/docs/NEWS.txt ============================================================================== --- Plone/branches/3.3/docs/NEWS.txt (original) +++ Plone/branches/3.3/docs/NEWS.txt Fri Mar 19 18:24:34 2010 @@ -19,6 +19,9 @@ Plone 3.3.2. This closes http://dev.plone.org/plone/ticket/10075 [vincentfretin] +- Fixed getIcon. 'Find and Catalog' works again. + This closes http://dev.plone.org/plone/ticket/8235 + [amleczko] 3.3.5 - March 3rd, 2010 ----------------------- |