[Zope-dev] CMF TypesTool breaks id

Alan Milligan alan at balclutha.org
Fri Apr 15 12:38:49 EDT 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm astounded that nobody has come across this before, but the
CMFCore.TypesTool.constructContent() function is supposed to return the
object id in the event that no RESPONSE is passed in - at least
according to CMFPlone.PloneFolder.invokeFactory().

Presently, it in fact returns nothing - breaking this implicit contract.

This has the unfortunate effect of *NOT* allowing you to generate your
own object id within your object construction function (we have a number
of requirements where external systems expect to see id's of particular
formats and I don't want to depend upon/pollute the generateId script
with specific meta_type requirements).

Plone's createObject script can't find this newly constructed object as
it's id isn't that generated by the generateId script and fails trying
to do a getTypeInfo() call on a None object.

I'm posting the patch here because in my mind this *IS* a very important
patch and I find the release schedule for CMF{Core,Default} inextricable ;)

Alan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFCX+AzCfroLk4EZpkRAq8tAKCVoo1JRfsueciFsJGg4WfMT2sqTgCgoyDF
5XtSXJ1IGopWx0FVQ2kct1M=
=MgKf
-----END PGP SIGNATURE-----
-------------- next part --------------
--- CMFCore/TypesTool.py.orig	2005-04-16 01:04:05.181168664 +1000
+++ CMFCore/TypesTool.py	2005-04-16 00:58:19.661695608 +1000
@@ -712,6 +712,7 @@
             immediate_url = '%s/%s' % ( ob.absolute_url()
                                       , info.immediate_view )
             RESPONSE.redirect( immediate_url )
+	return ob.getId()
 
     security.declarePrivate( 'listActions' )
     def listActions( self, info=None ):


More information about the Zope-Dev mailing list