plone.app.contenttypes/master: Merge pull request #419 from plone/migrate_richtext_during_t

GitHub <jenkins-z4DKO/[email protected]>
Newsgroups gmane.comp.web.zope.plone.cvs
Message-ID <[email protected]>
Repository: plone.app.contenttypes
Branch: refs/heads/master
Date: 2017-07-24T12:06:03+02:00
Author: Philip Bauer (pbauer) <[email protected]>
Commit: https://github.com/plone/plone.app.contenttypes/commit/f390079e7502e665f13c29149432468ab3ca808c

Merge pull request #419 from plone/migrate_richtext_during_topicmigration

Migrate the richtext-field 'text' when migrating ATTopics to Collections

Files changed:
M CHANGES.rst
M plone/app/contenttypes/migration/topics.py
M plone/app/contenttypes/tests/test_migration_topic.py

diff --git a/CHANGES.rst b/CHANGES.rst
index 23cb51f9..af829de3 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -18,6 +18,9 @@ New features:
 
 Bug fixes:
 
+- Migrate the richtext-field 'text' when migrating ATTopics to Collections.
+  [pbauer]
+
 - Remove Language='all' from migration-query since it was removed from p.a.multilingual
   [pbauer]
 
diff --git a/plone/app/contenttypes/migration/topics.py b/plone/app/contenttypes/migration/topics.py
index 6550cd9c..fb021fa9 100644
--- a/plone/app/contenttypes/migration/topics.py
+++ b/plone/app/contenttypes/migration/topics.py
@@ -10,6 +10,7 @@
 
 from DateTime import DateTime
 from plone.app.contenttypes.behaviors.collection import ICollection
+from plone.app.contenttypes.migration.field_migrators import migrate_richtextfield  # noqa: E501
 from plone.app.contenttypes.upgrades import LISTING_VIEW_MAPPING
 from plone.app.querystring.interfaces import IQuerystringRegistryReader
 from plone.registry.interfaces import IRegistry
@@ -546,6 +547,9 @@ def migrate_atctmetadata(self):
         field = self.old.getField('excludeFromNav')
         self.new.exclude_from_nav = field.get(self.old)
 
+    def migrate_schema_fields(self):
+        migrate_richtextfield(self.old, self.new, 'text', 'text')
+
     def migrate_at_uuid(self):
         """Migrate AT universal uid
         """
@@ -651,6 +655,9 @@ def migrate_atctmetadata(self):
         field = self.old.getField('excludeFromNav')
         self.new.exclude_from_nav = field.get(self.old)
 
+    def migrate_schema_fields(self):
+        migrate_richtextfield(self.old, self.new, 'text', 'text')
+
     def migrate_at_uuid(self):
         """Migrate AT universal uid
         """
diff --git a/plone/app/contenttypes/tests/test_migration_topic.py b/plone/app/contenttypes/tests/test_migration_topic.py
index c616564a..6a1dfafc 100644
--- a/plone/app/contenttypes/tests/test_migration_topic.py
+++ b/plone/app/contenttypes/tests/test_migration_topic.py
@@ -79,6 +79,7 @@ def test_migrate_topic_fields(self):
         self.assertEqual(self.portal.topic.portal_type, 'Collection')
         self.assertEqual(new.limit, 42)
         self.assertEqual(new.customViewFields, ('Title', 'Type'))
+        self.assertEqual(self.portal.topic.text.raw, u'<p>Hello</p>')
 
     def test_migrate_layout(self):
         self.portal.topic.setLayout('folder_summary_view')



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
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.