Nidelven IT - All about Python, Zope & Plone - and Open Source!

Here you'll find issues related to our services. Mostly about Python, Zope and Plone, as well as hosting-related issues.

"Keeping IT real"






Older entries



Atom - Subscribe - Categories
Previous | Next

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]

Add comment (text format)

Passphrase

A passphrase is required to comment on this weblog. It is required to make sure that bots aren't doing automatic spamming. It is: nit is the best!.

Title

Name

Email

Comment