Permalink
Browse files

Fix BLOB migration when LinguaPlone is installed.

When LinguaPlone is installed, translations are updated for language
independent fields, some of which may not have been migrated yet.
Since the migrator was passing in an actual content object to the
mutator but only the ATBlob mutator could handle that and not the old
ATImage mutator, this was causing the migration to fail for individual
images that had translations.

A further side-effect of this exposes a potential ZODB bug.  When the
migration fails for an individual image, the savepoint is rolled
back.  When the transaction is then committed for those images the
transaction succeeded for a POSKeyError can happen.
  • Loading branch information...
1 parent 201f283 commit d06895d4a026539e5eb8717e7df9832104bf350c @rpatterson rpatterson committed Nov 21, 2012
Showing with 4 additions and 2 deletions.
  1. +2 −1 CHANGES.txt
  2. +2 −1 src/plone/app/blob/migrations.py
View
@@ -4,7 +4,8 @@ Changelog
1.5.5 (unreleased)
------------------
-- Nothing changed yet.
+- Fix BLOB migration when LinguaPlone is installed.
+ [rpatterson]
1.5.4 (2012-10-15)
@@ -137,7 +137,8 @@ class ATImageToBlobImageMigrator(ATFileToBlobMigrator):
}
def migrate_data(self):
- self.new.getField('image').getMutator(self.new)(self.old)
+ value = self.old.getField('image').getAccessor(self.old)()
+ self.new.getField('image').getMutator(self.new)(value)
def getATBlobImagesMigrationWalker(self):

0 comments on commit d06895d

Please sign in to comment.