Skip to content

Commit

Permalink
[fc] Repository: plone.app.upgrade
Browse files Browse the repository at this point in the history
Branch: refs/heads/master
Date: 2017-10-11T01:05:00+02:00
Author: Maurits van Rees (mauritsvanrees) <[email protected]>
Commit: plone/plone.app.upgrade@4305ce0

Fixed WrongType exception when migrating installed Iterate to 5.0.

This mitigates the effects from plone/plone.app.upgrade#136

Files changed:
M CHANGES.rst
M plone/app/upgrade/v50/betas.py
Repository: plone.app.upgrade

Branch: refs/heads/master
Date: 2017-10-11T12:19:10+02:00
Author: Jens W. Klein (jensens) <[email protected]>
Commit: plone/plone.app.upgrade@7142a0c

Merge pull request #140 from plone/iterate-both-str-unicode

Fixed WrongType exception when migrating installed Iterate to 5.0.

Files changed:
M CHANGES.rst
M plone/app/upgrade/v50/betas.py
  • Loading branch information
jensens committed Oct 11, 2017
1 parent 1615224 commit 295657f
Showing 1 changed file with 80 additions and 147 deletions.
227 changes: 80 additions & 147 deletions last_commit.txt
Original file line number Diff line number Diff line change
@@ -1,187 +1,120 @@
Repository: Products.CMFPlone
Repository: plone.app.upgrade


Branch: refs/heads/5.0.x
Date: 2017-10-11T00:28:21+02:00
Branch: refs/heads/master
Date: 2017-10-11T01:05:00+02:00
Author: Maurits van Rees (mauritsvanrees) <[email protected]>
Commit: https://github.com/plone/Products.CMFPlone/commit/aa6d5c2ce42d3bd37155316e88e34bd6da2cd23b
Commit: https://github.com/plone/plone.app.upgrade/commit/4305ce058f08648232354cb0f78b02f9dd38b6fc

Fixed Products.CMFPlacefulWorkflow marked uninstalled after upgrade from 4.3.
Fixed WrongType exception when migrating installed Iterate to 5.0.

This is true for any package in the Products namespace that was installed.
Fixes https://github.com/plone/Products.CMFPlone/issues/2103.
This mitigates the effects from https://github.com/plone/plone.app.upgrade/pull/136

Files changed:
M CHANGES.rst
M Products/CMFPlone/controlpanel/browser/quickinstaller.py
M plone/app/upgrade/v50/betas.py

diff --git a/CHANGES.rst b/CHANGES.rst
index 7d3f79f91..6ee74a773 100644
index 4e70d97..47b6d40 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -23,7 +23,10 @@ New features:
@@ -14,7 +14,8 @@ New features:

Bug fixes:

-- *add item here*
+- Fixed Products.CMFPlacefulWorkflow being marked as not installed after upgrade from 4.3.
+ This is true for any package in the Products namespace that was installed.
+ Fixes `issue 2103 <https://github.com/plone/Products.CMFPlone/issues/2103>`_.
+- Fixed WrongType exception when migrating installed Iterate to 5.0.
+ [maurits]


5.0.9 (2017-08-05)
diff --git a/Products/CMFPlone/controlpanel/browser/quickinstaller.py b/Products/CMFPlone/controlpanel/browser/quickinstaller.py
index ecc99f2e7..4ea3858ff 100644
--- a/Products/CMFPlone/controlpanel/browser/quickinstaller.py
+++ b/Products/CMFPlone/controlpanel/browser/quickinstaller.py
@@ -64,6 +64,15 @@ def marshall_addons(self):
installed = False
upgrade_info = None
p_obj = self.qi._getOb(product_id, None)
+ if p_obj is None and product_id.startswith('Products.'):
+ # Install Products.CMFPlacefulWorkflow in 4.3, and it will
+ # create a CMFPlacefulWorkflow object. But here we look
+ # for product_id Products.CMFPlacefulWorkflow. We should
+ # look for CMFPlacefulWorkflow too.
+ product_id2 = product_id[len('Products.'):]
+ p_obj = self.qi._getOb(product_id2, None)
+ if p_obj is not None:
+ product_id = product_id2
if p_obj:
# TODO; if you install then uninstall, the
# presence lingers in the qi. Before it is
@@ -85,20 +94,24 @@ def marshall_addons(self):
# to get CMFPlacefulWorkflow to show up in addons
# If it's safe to rename profiles, we can do that too
2.0.8 (2017-09-25)
diff --git a/plone/app/upgrade/v50/betas.py b/plone/app/upgrade/v50/betas.py
index 59412f4..c7a3487 100644
--- a/plone/app/upgrade/v50/betas.py
+++ b/plone/app/upgrade/v50/betas.py
@@ -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

- addons[product_id] = {
- 'id': product_id,
- 'version': self.get_product_version(product_id),
- 'title': product_id,
- 'description': '',
- 'product_file': product_file,
- 'upgrade_profiles': {},
- 'other_profiles': [],
- 'install_profile': None,
- 'uninstall_profile': None,
- 'is_installed': installed,
- 'upgrade_info': upgrade_info,
- 'profile_type': profile_type,
- }
+ # product_id might have changed, if it began with 'Products.',
+ # so check again to prevent losing information from a previous
+ # profile.
+ if product_id not in addons:
+ addons[product_id] = {
+ 'id': product_id,
+ 'version': self.get_product_version(product_id),
+ 'title': product_id,
+ 'description': '',
+ 'product_file': product_file,
+ 'upgrade_profiles': {},
+ 'other_profiles': [],
+ 'install_profile': None,
+ 'uninstall_profile': None,
+ 'is_installed': installed,
+ 'upgrade_info': upgrade_info,
+ 'profile_type': profile_type,
+ }
product = addons[product_id]
if profile_type == 'default':
product['title'] = profile['title']


Repository: Products.CMFPlone


Branch: refs/heads/5.0.x
Date: 2017-10-11T12:17:12+02:00
import logging
import pkg_resources
@@ -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'):


Repository: plone.app.upgrade


Branch: refs/heads/master
Date: 2017-10-11T12:19:10+02:00
Author: Jens W. Klein (jensens) <[email protected]>
Commit: https://github.com/plone/Products.CMFPlone/commit/d6a530c5038e5ca6358e8c1e0a20b2cd6bfe761c
Commit: https://github.com/plone/plone.app.upgrade/commit/7142a0cc155ba129b9aa88f35d8ce257df9b4ff9

Merge pull request #2173 from plone/issue-2103-products-uninstalled
Merge pull request #140 from plone/iterate-both-str-unicode

Fixed Products.CMFPlacefulWorkflow marked uninstalled after upgrade 4.3-5.0
Fixed WrongType exception when migrating installed Iterate to 5.0.

Files changed:
M CHANGES.rst
M Products/CMFPlone/controlpanel/browser/quickinstaller.py
M plone/app/upgrade/v50/betas.py

diff --git a/CHANGES.rst b/CHANGES.rst
index 7d3f79f91..6ee74a773 100644
index 4e70d97..47b6d40 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -23,7 +23,10 @@ New features:
@@ -14,7 +14,8 @@ New features:

Bug fixes:

-- *add item here*
+- Fixed Products.CMFPlacefulWorkflow being marked as not installed after upgrade from 4.3.
+ This is true for any package in the Products namespace that was installed.
+ Fixes `issue 2103 <https://github.com/plone/Products.CMFPlone/issues/2103>`_.
+- Fixed WrongType exception when migrating installed Iterate to 5.0.
+ [maurits]


5.0.9 (2017-08-05)
diff --git a/Products/CMFPlone/controlpanel/browser/quickinstaller.py b/Products/CMFPlone/controlpanel/browser/quickinstaller.py
index ecc99f2e7..4ea3858ff 100644
--- a/Products/CMFPlone/controlpanel/browser/quickinstaller.py
+++ b/Products/CMFPlone/controlpanel/browser/quickinstaller.py
@@ -64,6 +64,15 @@ def marshall_addons(self):
installed = False
upgrade_info = None
p_obj = self.qi._getOb(product_id, None)
+ if p_obj is None and product_id.startswith('Products.'):
+ # Install Products.CMFPlacefulWorkflow in 4.3, and it will
+ # create a CMFPlacefulWorkflow object. But here we look
+ # for product_id Products.CMFPlacefulWorkflow. We should
+ # look for CMFPlacefulWorkflow too.
+ product_id2 = product_id[len('Products.'):]
+ p_obj = self.qi._getOb(product_id2, None)
+ if p_obj is not None:
+ product_id = product_id2
if p_obj:
# TODO; if you install then uninstall, the
# presence lingers in the qi. Before it is
@@ -85,20 +94,24 @@ def marshall_addons(self):
# to get CMFPlacefulWorkflow to show up in addons
# If it's safe to rename profiles, we can do that too
2.0.8 (2017-09-25)
diff --git a/plone/app/upgrade/v50/betas.py b/plone/app/upgrade/v50/betas.py
index 59412f4..c7a3487 100644
--- a/plone/app/upgrade/v50/betas.py
+++ b/plone/app/upgrade/v50/betas.py
@@ -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
@@ -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')

- addons[product_id] = {
- 'id': product_id,
- 'version': self.get_product_version(product_id),
- 'title': product_id,
- 'description': '',
- 'product_file': product_file,
- 'upgrade_profiles': {},
- 'other_profiles': [],
- 'install_profile': None,
- 'uninstall_profile': None,
- 'is_installed': installed,
- 'upgrade_info': upgrade_info,
- 'profile_type': profile_type,
- }
+ # product_id might have changed, if it began with 'Products.',
+ # so check again to prevent losing information from a previous
+ # profile.
+ if product_id not in addons:
+ addons[product_id] = {
+ 'id': product_id,
+ 'version': self.get_product_version(product_id),
+ 'title': product_id,
+ 'description': '',
+ 'product_file': product_file,
+ 'upgrade_profiles': {},
+ 'other_profiles': [],
+ 'install_profile': None,
+ 'uninstall_profile': None,
+ 'is_installed': installed,
+ 'upgrade_info': upgrade_info,
+ 'profile_type': profile_type,
+ }
product = addons[product_id]
if profile_type == 'default':
product['title'] = profile['title']
if site_properties.hasProperty('default_page_types'):


0 comments on commit 295657f

Please sign in to comment.