[Zope] bug in ZClasses: Folderish ZClass shows wrong "subobjects"meta_types

Casey Duncan cduncan@kaivo.com
Thu, 17 May 2001 08:45:20 -0600


Danny William Adair wrote:
> 
> Hi!
> 
> For my folderish ZClass I find "subobjects" in the management screen to
> determine which objects are allowed to be added inside my ObjectManager.
> The "subobjects" tab shows me a list of meta_types to choose from, so that
> I can make sure I don't get a "the object xyz doesn' t support this
> operation" when creating/pasting objects of that metatype.
> 
> But the list is faulty! :-o
> 
> :-o
> 
> 1) Created folderish ZClass "Universe" ,metatype "Hello Universe"
> 2) Created folderish ZClass "World" ,metatype "World"
> 3) Added "World" to the allowed subobjects list of "Universe"
> 
> That's ok. Works as expected. Now let's say I find out that "World" is a
> bad meta_type (there can be several reasons for this, for example someone
> else has just released a wonderful product, which instantiates "World" objects)
> 
> Now...
> 
> 4) Changed the metatype of ZClass "World" to "Hello World"
> 5) Damn, *now I can't add any World instances in my Universe instances
> anymore* :-(
>      So, then Universe's "allowed subobjects" list wasn't adjusted
> automatically... mmmh, ok. Then I' ll do it manually.
> 6) Right, go to ZClass "Universe" and look under subobjects to correct the
> entry...
> 
> Boing!
> 
> I only find "World" in the list, although this metatype shouldn' t exist
> anymore. But I can' t find the new metatype, "Hello World", and so I will
> never ever again be able to add them in a Universe instance. Can anyone
> reproduce this misbehavior?

Did you also change the Add list name in the factory to the same value
as the meta_type? I know if they differ it can cause problems.

> 
> Now, how can I fix this once it has happened? I love "Hello World" and I
> hate "World", so how can I get it back?
> My first attempt was to rename the ZClasses and add new ones... bang.
> 
> "The permission Add Hello Worlds is already defined."
> Ok, break, this will get way to complicated...

It sounds like you still had "Create constructor objects" checked when
you recreated your ZClass. Either delete the constructor, form, factory
and permission first (recommended) or uncheck this.

> 
> So then, I would call this a bug in ZClasses, can somebody confirm this?
> 
>      def possible_meta_types(self):
>          return self.aq_acquire('_product_meta_types')+Products.meta_types
> 
> This is what the management screen calls to show me the wrong list, maybe
> someone knows what's happening here and how to fix this?
> 
> tia,
> Danny
> 

-- 
| Casey Duncan
| Kaivo, Inc.
| cduncan@kaivo.com
`------------------>