[Zope-CMF] error on renaming a custom content type
Florent Guillaume
fg@nuxeo.com
Sat, 3 Aug 2002 15:01:17 +0000 (UTC)
Aaron Payne <aaron@aaronpayne.com> wrote:
> Hi Florent,
>
> On Friday, August 2, 2002, at 10:25 PM, Florent Guillaume wrote:
>
> > 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.
>
> > 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.
> >
> >
>
> This helped a bit. I can now rename the objects but there is still a
> problem. When iterating through the object actions for this content
> type, the old id is still used in creating the link to the action
> form. I am using a plain cmf site for these tests.
Actually I'm not sure the fix I proposed is completely correct.
The real question is, why don't you use CMFDefault.Image?
Florent
--
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 87 http://nuxeo.com mailto:fg@nuxeo.com