[Zope-CMF] portal_catalog fails to update

Gitte Wange gitte@mmmanager.org
Tue, 18 Jun 2002 09:52:21 +0200


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