Skip to content

Commit

Permalink
Fixed WrongType exception when migrating installed Iterate to 5.0.
Browse files Browse the repository at this point in the history
This mitigates the effects from #136
  • Loading branch information
mauritsvanrees committed Oct 10, 2017
1 parent 8c47251 commit 4305ce0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ New features:

Bug fixes:

- *add item here*
- Fixed WrongType exception when migrating installed Iterate to 5.0.
[maurits]


2.0.8 (2017-09-25)
Expand Down
10 changes: 9 additions & 1 deletion plone/app/upgrade/v50/betas.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from Products.CMFPlone.utils import safe_unicode
from zope.component import getUtility
from zope.component.hooks import getSite
from zope.schema._bootstrapinterfaces import WrongType

import logging
import pkg_resources
Expand Down Expand Up @@ -570,7 +571,14 @@ def to50rc3(context):
value = site_properties.getProperty('checkout_workflow_policy')
from plone.app.iterate.interfaces import IIterateSettings
settings = registry.forInterface(IIterateSettings)
settings.checkout_workflow_policy = str(value)
# Some versions of plone.app.iterate require a string here,
# others a unicode. Best seems to be to try both.
try:
# plone.app.iterate 3.3.2+
settings.checkout_workflow_policy = str(value)
except WrongType:
# plone.app.iterate 3.3.1-
settings.checkout_workflow_policy = safe_unicode(value)
site_properties._delProperty('checkout_workflow_policy')

if site_properties.hasProperty('default_page_types'):
Expand Down

0 comments on commit 4305ce0

Please sign in to comment.