diff --git a/CHANGES.rst b/CHANGES.rst index e602b1308..d8cf34ba3 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -6,7 +6,7 @@ There's a frood who really knows where his towel is. 1.3b2 (unreleased) ^^^^^^^^^^^^^^^^^^ -- Use timestamp object instead of string of timestamp to represent image modified date (fixes `#686`_). +- Fix ``TypeError`` when changing default image scale on basic tiles (fixes `#686`_). [rodfersou] - Fixed adding a 'more' link in list tiles. diff --git a/src/collective/cover/tests/test_upgrades.py b/src/collective/cover/tests/test_upgrades.py index 4c9a9de52..4069e245a 100644 --- a/src/collective/cover/tests/test_upgrades.py +++ b/src/collective/cover/tests/test_upgrades.py @@ -3,7 +3,6 @@ from collective.cover.config import IS_PLONE_5 from collective.cover.controlpanel import ICoverSettings from collective.cover.testing import INTEGRATION_TESTING -from persistent.dict import PersistentDict from persistent.mapping import PersistentMapping from plone import api from plone.registry.interfaces import IRegistry @@ -590,8 +589,9 @@ def test_registrations(self): self.assertGreaterEqual(int(version), int(self.to_version)) self.assertEqual(self._how_many_upgrades_to_do(), 2) - def test_fix_image_modified_date(self): - title = u'Update all tiles to fix modified date' + def test_fix_image_field_modification_time(self): + from persistent.dict import PersistentDict + title = u'Fix image field modification time' step = self._get_upgrade_step(title) assert step is not None @@ -614,7 +614,7 @@ def test_fix_image_modified_date(self): dmgr.annotations[dmgr.key] = PersistentDict(old_data) data = dmgr.get() - self.assertIsInstance(data['image_mtime'], str) + assert isinstance(data['image_mtime'], str) # run the upgrade step to validate the update self._do_upgrade_step(step) diff --git a/src/collective/cover/upgrades/v15/__init__.py b/src/collective/cover/upgrades/v15/__init__.py index ade549f55..045f3e0e4 100644 --- a/src/collective/cover/upgrades/v15/__init__.py +++ b/src/collective/cover/upgrades/v15/__init__.py @@ -5,8 +5,8 @@ from plone.tiles.interfaces import ITileDataManager -def fix_image_modified_date(context): - """Update all tiles to fix modified date""" +def fix_image_field_modification_time(context): + """Fix image modification time to be float timestamp instead of string.""" covers = context.portal_catalog(portal_type='collective.cover.content') logger.info('About to update {0} objects'.format(len(covers))) diff --git a/src/collective/cover/upgrades/v15/configure.zcml b/src/collective/cover/upgrades/v15/configure.zcml index 5c8d2bd01..78e047795 100644 --- a/src/collective/cover/upgrades/v15/configure.zcml +++ b/src/collective/cover/upgrades/v15/configure.zcml @@ -10,9 +10,9 @@ profile="collective.cover:default">