[Zope-CMF] bug (or feature) with Type() field in catalog for newly created CMF objects

Joseph Wayne Norton norton@alum.mit.edu
Wed, 12 Sep 2001 18:07:02 +0900


Jon -

The following patch in the CMF src code works for me.  Please ignore
the first part (I use this to allow the add function to generate its
own id if id is NULL).  The penalty is that the object is indexed
twice after addition.

- j

===================================================================
RCS file: /cvs-repository/CMF/CMFCore/TypesTool.py,v
retrieving revision 1.19
diff -r1.19 TypesTool.py
488c488,490
<             apply(m, (id,) + args, kw)
---
>             mid = apply(m, (id,) + args, kw)
>             if mid is not None:
>                 id = mid
491a494
>             ob.reindexObject()



At Tue, 11 Sep 2001 11:04:25 +0100,
Jon Edwards wrote:
> 
> > It's a bug, I think I put it in the tracker. Tres said something about
> head
> > hurting when I broguht it up ;-)
> 
> Aha! I've been bitten by this one I think -
> http://lists.zope.org/pipermail/zope-cmf/2001-September/009603.html
> 
> As a workround, could you "manually" do -
> 
>   <dtml-call manage_changeProperties(portal_type = 'My Type')>
>   <dtml-call "reindexObject()">
> 
> - (or the python equivalent) in the method/script you're using to create the
> objects?
> 
> Cheers, Jon
> 


At Tue, 11 Sep 2001 11:04:25 +0100,
Jon Edwards wrote:
> 
> > It's a bug, I think I put it in the tracker. Tres said something about
> head
> > hurting when I broguht it up ;-)
> 
> Aha! I've been bitten by this one I think -
> http://lists.zope.org/pipermail/zope-cmf/2001-September/009603.html
> 
> As a workround, could you "manually" do -
> 
>   <dtml-call manage_changeProperties(portal_type = 'My Type')>
>   <dtml-call "reindexObject()">
> 
> - (or the python equivalent) in the method/script you're using to create the
> objects?
> 
> Cheers, Jon
>