[Zope-CMF] Error trying to add FTI

Jon Edwards jon@pcgs.freeserve.co.uk
Mon, 22 Apr 2002 17:18:18 +0100

I created a product "Medzope" which had a couple of subproducts - all worked
OK. But now I've added another sub-product (Contact), it doesn't seem to be
registering itself properly, can someone pleeeeease point out my dumb

I think the mistake might be in my init.py, where I do the ContentInit -

        'Medzope Content',
        content_types = (MedzopeFolder.MedzopeFolder, MedzopeOrg.MedzopeOrg,
        permission = ADD_FOLDERS_PERMISSION,
        extra_constructors = (MedzopeFolder.addMedzopeFolder,
MedzopeOrg.addMedzopeOrg, Contact.addContact),
MedzopeOrg.factory_type_information, Contact.factory_type_information)

Everything seems to initialise without errors, and I can add my new
"Contact" objects through the ZMI. But "Contact" is not listed in the
TypesTool, so I tried to add a new Factory-based Type Information, and
immediately got the following error -


Sorry, a site error occurred.

Traceback (innermost last):
  File C:\Program Files\testzope250\lib\python\ZPublisher\Publish.py, line
150, in publish_module
  File C:\Program Files\testzope250\lib\python\ZPublisher\Publish.py, line
114, in publish
  File C:\Program Files\testzope250\lib\python\Zope\__init__.py, line 158,
in zpublisher_exception_hook
    (Object: portal_types)
  File C:\Program Files\testzope250\lib\python\ZPublisher\Publish.py, line
98, in publish
  File C:\Program Files\testzope250\lib\python\ZPublisher\mapply.py, line
88, in mapply
    (Object: manage_addFactoryTIForm)
  File C:\Program Files\testzope250\lib\python\ZPublisher\Publish.py, line
39, in call_object
    (Object: manage_addFactoryTIForm)
  File C:\Program
Files\testzope250\lib\python\Products\CMFCore\TypesTool.py, line 578, in
    (Object: portal_types)
  File C:\Program
Files\testzope250\lib\python\Products\CMFCore\TypesTool.py, line 567, in
    (Object: portal_types)
AttributeError: 'tuple' object has no attribute 'get'

Looking at TypesTool, I think it's trying to get the meta_type of the FTI?
But it seems that something in the way I initialised it has caused that not
to be stored, or to be stored wrongly? (I've declared both meta_type and
portal_type as Contact in Contact.py)

Any clues gratefully accepted!

Cheers, Jon