[Testbot] Plone 5.0 - Python 2.7 - Build # 3145 - Still failing! - 0 failure(s)

jenkins at plone.org jenkins at plone.org
Fri Sep 5 11:48:55 UTC 2014


-------------------------------------------------------------------------------
Plone 5.0 - Python 2.7 - Build # 3145 - Still Failing!
-------------------------------------------------------------------------------

http://jenkins.plone.org/job/plone-5.0-python-2.7/3145/


-------------------------------------------------------------------------------
CHANGES
-------------------------------------------------------------------------------

Repository: plone.app.contenttypes
Branch: refs/heads/master
Date: 2014-09-05T12:23:51+02:00
Author: Philip Bauer (pbauer) <bauer at starzel.de>
Commit: https://github.com/plone/plone.app.contenttypes/commit/25c781a75497aba4882d0d57b4eff8ba660b4283

fix migrate_to_richtext to not purge existing behaviors

Files changed:
M plone/app/contenttypes/upgrades.py

diff --git a/plone/app/contenttypes/upgrades.py b/plone/app/contenttypes/upgrades.py
index 0660b20..5615b06 100644
--- a/plone/app/contenttypes/upgrades.py
+++ b/plone/app/contenttypes/upgrades.py
@@ -65,11 +65,25 @@ def enable_collection_behavior(context):
 def migrate_to_richtext(context):
     """Update fti's to add RichText behaviors and remove old text-fields."""
 
-    # TODO: Don't reload the profile. Only change the settings.
-    context.runImportStepFromProfile(
-        'profile-plone.app.contenttypes:default',
-        'typeinfo',
-    )
+    behavior = "plone.app.contenttypes.behaviors.richtext.IRichText"
+    types = [
+        "Document",
+        "News Item",
+        "Event",
+        "Collection",
+    ]
+    for type_name in types:
+        fti = queryUtility(
+            IDexterityFTI,
+            name=type_name
+        )
+        if not fti:
+            continue
+        if behavior in fti.behaviors:
+            continue
+        behaviors = list(fti.behaviors)
+        behaviors.append(behavior)
+        fti._updateProperty('behaviors', tuple(behaviors))
 
 
 def migrate_album_view(context):




-------------------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CHANGES.log
Type: application/octet-stream
Size: 1495 bytes
Desc: not available
URL: <http://lists.plone.org/pipermail/plone-testbot/attachments/20140905/bcfb5ab2/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: build.log
Type: application/octet-stream
Size: 92346 bytes
Desc: not available
URL: <http://lists.plone.org/pipermail/plone-testbot/attachments/20140905/bcfb5ab2/attachment-0003.obj>


More information about the Testbot mailing list