Making PatchPloneContent play nicely with blobs
So I'm upgrading this old site that has iw.fss as the storage system for blob content and was struggling a while with some content not having all their Archetypes schema content transferred during a Plone upgrade.
The code seemed fine and I couldn't find a problem so the debugger was brought out to look at what was going on with certain types of content.
It turns out the issue is rather simple, the product I'm using to patch content types with extra schema fields (Products.PatchPloneContent) doesn't include ATBlob as a content type (...)
There is something to be said about keeping things in one place, but it was probably all good intentions when the blob content type was put in the plone.app.blob package instead of inside ATContentTypes. Anyway, the fix was simple:
try: from plone.app.blob.content import ATBlob content_classes = ( ATFolder, document.ATDocument, event.ATEvent, file.ATFile, image.ATImage, link.ATLink, newsitem.ATNewsItem, topic.ATTopic, ATBlob ) except ImportError: content_classes = ( ATFolder, document.ATDocument, event.ATEvent, file.ATFile, image.ATImage, link.ATLink, newsitem.ATNewsItem, topic.ATTopic, )
That code should work for Plone 4 and 3 as well, and now the rather simple PatchPloneContent product has proper support for blobs as well.
Updated to strip invalid feed code. [Later.. Update 2 to please the POP crowd]
[Permalink] [By morphex] [Python, Zope, Plone - and anything loosely related to that (Atom feed)] [2012 26 Jul 14:29 GMT+2]