[Zope-CMF] error on renaming a custom content type
Florent Guillaume
fg@nuxeo.com
Sat, 3 Aug 2002 03:25:06 +0000 (UTC)
Aaron Payne <aaron@aaronpayne.com> wrote:
> I've written a custom content type Biography for my cmf site based on
> the event type in CMFCalendar. The new type is subclassed
> OFS.Image.Image, PortalContent, DefaultDublinCoreImpl (in that order.)
>
> I can add, edit, delete or view an instance of the custom type with no
> problem.
> Once I rename the instance, I lose the ability to perform any of these
> actions.
>
> Calling getId() on the object returns the old id of the object. In the
> ZMI I can see the renamed instance but in the folder_contents view the
> instance still shows the old id.
>
> Any thoughts, suggestions on what is happening here?
Hmm, yes, Image is actually deriving from Item_w__name__. The problem is
that Item_w__name__ has:
def _setId(self, id):
self.__name__=id
One way to fix your problem would be to subclass, in that order, from:
OFS.CopySupport.CopySource
OFS.Image.Image
PortalContent
DefaultDublinCoreImpl
because CopySource will expose the correct _setId.
BTW can someone enlighten us on the purpose of Item_w__name__ wrt Item?
Florent
--
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 87 http://nuxeo.com mailto:fg@nuxeo.com