Changeset 2416


Ignore:
Timestamp:
06/17/08 17:25:58 (11 years ago)
Author:
anonymous
Message:

Fixed issue where checks for good title used catalog fields which aren't there and returned all catalog objects in deletion list.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/ConfigurationMethods.py

    r2410 r2416  
    319319    #    pass 
    320320    try: 
     321        catalog_tool.manage_addIndex("sortable_title", "FieldIndex")     
     322    except CatalogError: 
     323        pass # index already exists 
     324    try: 
    321325        catalog_tool.manage_addColumn("sortable_title")     
    322326    except CatalogError: 
     
    338342    except CatalogError: 
    339343        pass # metadata already exists 
     344 
     345 
    340346         
    341347    # BAD INDEXES AND METADATA: 
  • trunk/LeMillCatalogTool.py

    r2409 r2416  
    2525    def catalog_object(self, object, uid, idxs=[], 
    2626                       update_metadata=1, pghandler=None): 
    27         ZCatalog.catalog_object(self, object, uid, idxs, 
    28                                 update_metadata, pghandler=pghandler) 
     27        if object.portal_type!='CollectionsFolder': 
     28            ZCatalog.catalog_object(self, object, uid, idxs, update_metadata, pghandler=pghandler) 
    2929 
    3030    def searchResults(self, REQUEST=None, **kw): 
     
    3434    __call__ = searchResults 
    3535 
     36 
    3637CatalogTool.__doc__ = PloneCatalogTool.__doc__ 
    3738 
  • trunk/LeMillTool.py

    r2413 r2416  
    506506            objUID=obj.UID() 
    507507            if hasattr(obj, 'getTranslationsOfOriginal'): # Make a list of translations                  
    508                 ids_of_translations=[x.id.rstrip('-0123456789') for x in obj.getTranslationsOfOriginal()] 
     508                ids_of_translations=[x.getId.rstrip('-0123456789') for x in obj.getTranslationsOfOriginal()] 
    509509        # If we return True, but obj id is still reserved, plone machinery will give it id-1, id-2.. 
    510510        # So pieces always return true, but we still want them to overwrite deleted and redirectors. 
     
    520520        # Will this title make a good id?         
    521521        tempid=plone_tool.normalizeString(title) 
    522         matches=pc({'id':tempid}) 
     522        matches=pc({'getId':tempid}) 
    523523        if matches: 
    524524            for match in matches: 
     
    528528 
    529529        # If otherwise ok, delete Redirectors and Deleted objects from our way. 
     530        #print 'delete_list: %s' % delete_list 
     531        if len(delete_list)>20: raise hell # If something goes badly wrong, let's not delete all 
     532 
    530533        for o in delete_list: 
    531             delid=o.id 
     534            delid=o.getId 
    532535            # getObject verified 
    533536            o=o.getObject() 
     
    12671270                    if output: print response 
    12681271            except: # any failure will cause uncataloging 
    1269                 response='%s removed bad object %s (%s)\n' % (response, md_obj.id, md_obj.getRID())  
     1272                response='%s removed bad object %s (%s)\n' % (response, md_obj.getId, md_obj.getRID())  
    12701273                if output: print response 
    12711274                pc.uncatalog_object(pc.getpath(md_obj.getRID())) 
  • trunk/Resources.py

    r2415 r2416  
    319319        for md in self.getTranslationsOfOriginal(include_original=True): 
    320320            resource={} 
    321             resource['isThis'] = self.id==md.id 
     321            resource['isThis'] = self.id==md.getId 
    322322            resource['url'] = md.absolute_url() 
    323323            resource['languageName'] = self.lemill_tool.getPrettyLanguage(md.Language()) 
Note: See TracChangeset for help on using the changeset viewer.