[Zope-CMF] portal_catalog fails to update

Tres Seaver tseaver@zope.com
18 Jun 2002 13:40:19 -0400


On Tue, 2002-06-18 at 10:36, Kevin Carlson wrote:
> Thanks, Gitte.  This works.  Any idea why a catalog aware object would just
> stop reindexing itself, though?

Catalog-aware content has always been responsible for reindexing itself
after updates;  the base class can only help with the "after add" and
"before delete" cases.  What probably happened is that some method you
call inside your own 'edit' method used to call 'reindexObject', and now
no longer does because, in the class where it is declared, another
method now does that.

That is just a guess, though.

Tres.
> 
> -----Original Message-----
> From: Gitte Wange [mailto:gitte@mmmanager.org]
> Sent: Tuesday, June 18, 2002 3:52 AM
> To: Kevin Carlson; zope-cmf@zope.org
> Subject: Re: [Zope-CMF] portal_catalog fails to update
> 
> 
> 
> 
> Kevin Carlson wrote:
> 
> > For some reason, the portal_catalog is failing to update indexes and
> > metadata that were previously working fine.  When I add a new document
> > (Portal File) in a script I am calling the following functions:
> >
> >    typesTool.constructContent(docType, homeFolder, ts)
> >    newDoc = homeFolder[ts]
> >
> >    ##########################
> >    # process metadata on form
> >    newDoc.editMetadata( title=docTitle
> >                         , description=desc
> >                         , subject=subject
> >                         , contributors=contributor
> >                         ,
> effective_date=effectiveDate.strftime("%Y/%m/%d")
> >                         )
> >
> >    ########################################
> >    # create plainText property and populate
> >    newDoc.manage_addProperty('pt', pt, 'text')
> >    newDoc.manage_addProperty('hpt', hpt, 'boolean')
> >    newDoc.manage_addProperty('flag', flag, 'boolean')
> >
> >    ####################
> >    # handle file upload
> >    newDoc.edit(file=filename)
> >
> > Previously, the newly created objects were being added correctly and the
> > catalog was being updated properly.  The properties (pt, hpt, and flag)
> are
> > not being updated in the catalog (there are indexes for each) even though
> > the properties exist in the document.  If I use the Update Catalog utility
> > on the Advanced Tab of the portal_catalog tool, the indexes and metadata
> are
> > properly updated.
> >
> > Does anyone know why this would happen?
> >
> > Thanks,
> >
> > Kevin
> 
> 
> Hi Kevin,
> 
> You nedd to call the reindexObject() method on the object when you have
> modified the object (e.g. in the edit function).
> 
> Greetings,
> Gitte Wange
> 
> 
> 
> 
> _______________________________________________
> Zope-CMF maillist  -  Zope-CMF@zope.org
> http://lists.zope.org/mailman/listinfo/zope-cmf
> 
> See http://www.zope.org/Products/PTK/Tracker for bug reports and feature requests
-- 
===============================================================
Tres Seaver                                tseaver@zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com