[Zope-CMF] problem with CMFTopic.

Romain Slootmaekers romain@zzict.com
Thu, 03 Apr 2003 02:48:03 +0200


Dieter Maurer wrote:
> Romain Slootmaekers wrote at 2003-4-2 17:12 +0200:
>  > I have some problems with CMFTopics being updated wrongly:
>  > 
>  > I built a custom CMF content type X, and I have the objects listed in a 
>  > Topic findX.
>  > 
>  > after I edit an instance x of X somewhere in the CMF site, the object is 
>  > listed twice in the CMFTopic findX.
>  > 
>  > My custom type X basically is declared like this:
>  > 
>  > class X(PortalContent, DefaultDublinCoreImpl):
>  >     """ PortalContent extends CMFCatalogAware """
>  >     ...
>  >     def edit(self,...):
>  >          ...
>  >          self.reindexObject() # make the catalog see our changes....
>  > 
>  > 
>  > 
>  > The funny thing is that a subsequent edits of the object will not make 
>  > it appear more than twice in the topic.
>  > 
>  > Anyone any clues ??
> 
> Topics are canned catalog searches.
> 
> A catalog search should only return duplicates when
> the object is catalogued with two different "uid"s.
> 
> When you do not specify the "uid", the object's physical
> path is used.
> 
> Can you check whether you object is indexed twice in the
> catalog (you would use the "getPath" method on the respective "brain"
> objects).
> 
The same object is indexed twice but with different paths.
I managed to solve to problem by making sure the object is accessed 
always in the same way.

Before, I used acquisition from outside the
portal to get access to the object before I called the edit method.
This seems to confuse the catalog.

Now I use path traversal from root of the portal and the problem is
gone. I still don't know what exactly the problem is though. :(

If I have time I'll try to device a small example to illustrate the 
behaviour.

Sloot.