Permalink
Browse files

Add another upgrade step to properly install p.a.discussion for Plone…

… 4.2 for Plone versions < 4.1.5 that have been migrated before. This fixes http://dev.plone.org/ticket/12058.
  • Loading branch information...
Timo Stollenwerk
Timo Stollenwerk committed Mar 19, 2012
1 parent 07dabbd commit e0cc4d2942426fefbc520aa1fc3ee366718f0906
Showing with 25 additions and 0 deletions.
  1. +19 −0 plone/app/upgrade/v42/betas.py
  2. +6 −0 plone/app/upgrade/v42/configure.zcml
@@ -1,6 +1,7 @@
import logging
from plone.app.upgrade.utils import loadMigrationProfile
+from plone.app.upgrade.utils import installOrReinstallProduct
from Products.CMFCore.utils import getToolByName
logger = logging.getLogger('plone.app.upgrade')
@@ -18,6 +19,15 @@ def fixOwnerTuple(obj, path):
portal.ZopeFindAndApply(portal, search_sub=True, apply_func=fixOwnerTuple)
+def installPloneAppDiscussion(portal):
+ # Make sure plone.app.discussion is properly installed.
+ installOrReinstallProduct(
+ portal,
+ "plone.app.discussion",
+ out=None,
+ hidden=True)
+
+
def to42beta1(context):
"""4.2a2 -> 4.2b1
"""
@@ -28,12 +38,21 @@ def to42beta1_owner_tuples(context):
portal = getToolByName(context, 'portal_url').getPortalObject()
fixOwnerTuples(portal)
+
def to42beta2(context):
"""4.2b1 -> 4.2b2
"""
loadMigrationProfile(context, 'profile-plone.app.upgrade.v42:to42beta2')
+
def to42rc1(context):
"""4.2b2 -> 4.2rc1
"""
loadMigrationProfile(context, 'profile-plone.app.upgrade.v42:to42rc1')
+
+
+def to42rc1_discussion(context):
+ """Fix discussion
+ """
+ portal = getToolByName(context, 'portal_url').getPortalObject()
+ installPloneAppDiscussion(portal)
@@ -75,6 +75,12 @@
handler=".betas.to42rc1"
/>
+ <genericsetup:upgradeStep
+ title="Fix discussion"
+ description=""
+ handler=".betas.to42rc1_discussion"
+ />
+
</genericsetup:upgradeSteps>
</configure>

0 comments on commit e0cc4d2

Please sign in to comment.