Re: "Object is of wrong type" with NamedBlogImage field

[email protected]
Newsgroups gmane.comp.web.zope.plone.user
Message-ID <[email protected]>
When I had this, it was because of the migration saved the filename encoded, but it should have been in unicode, if I remember correctly.

-Askp 

Andreas Jung kirjoitti Tue Sep 16 2014 12:24:50 GMT+0300 (EEST):
> Plone 4.3, Dexterity 2.
> 
> I have an image field
> 
>     image = NamedBlobImage(
>        title=_(u'label_special_image'),
>        description=_(u'help_special_image'),
>        required=False,
>     )
> 
> which is updated during a migration using
> 
>                 if new_obj.portal_type == 'Image':
>                     setattr(new_obj, k, namedfile.NamedBlobImage(v,
> filename=filename))
> 
> 
> The image is stored correctly and shown correctly in our own custom
> view. When we @@edit the content-type instance and save then we
> receive an error "Object is of wrong type" (see screenshot).
> The preview of the image is also being displayed correctly.
> 
> Why is this happening?
> 
> Andreas
>
------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce.
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.