Skip to content

Commit

Permalink
Run missing upgrade-step of plone.app.querystring when upgrading to 5…
Browse files Browse the repository at this point in the history
….0.2.

(and pep8)
  • Loading branch information
pbauer committed Jan 6, 2016
1 parent d15e133 commit 3bcedea
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 13 deletions.
7 changes: 4 additions & 3 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Changelog
1.3.20 (unreleased)
-------------------

- Nothing changed yet.
- Run missing upgrade-step of plone.app.querystring when upgrading to 5.0.2.
[pbauer]


1.3.19 (2015-12-17)
Expand All @@ -15,8 +16,8 @@ New:
- reapply profile for site-controlpanel
plone/Products.CMFPlone#124
[fgrcon]
- extended step to501 to recreate metadata for getIcon, see

- extended step to501 to recreate metadata for getIcon, see
plone/Products.CMFPlone#1226, #58, #60, #61
[fgrcon, gagaro, jensens]

Expand Down
16 changes: 8 additions & 8 deletions plone/app/upgrade/v50/betas.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,17 @@ def upgrade_portal_language(context):
lang_settings.use_combined_language_codes = portal_languages.use_combined_language_codes # noqa
lang_settings.display_flags = portal_languages.display_flags

lang_settings.use_path_negotiation = portal_languages.use_path_negotiation
lang_settings.use_content_negotiation = portal_languages.use_content_negotiation
lang_settings.use_cookie_negotiation = portal_languages.use_cookie_negotiation
lang_settings.use_path_negotiation = portal_languages.use_path_negotiation # noqa
lang_settings.use_content_negotiation = portal_languages.use_content_negotiation # noqa
lang_settings.use_cookie_negotiation = portal_languages.use_cookie_negotiation # noqa
if hasattr(portal_languages, 'set_cookie_everywhere'):
lang_settings.set_cookie_always = portal_languages.set_cookie_everywhere
lang_settings.authenticated_users_only = portal_languages.authenticated_users_only
lang_settings.use_request_negotiation = portal_languages.use_request_negotiation
lang_settings.use_cctld_negotiation = portal_languages.use_cctld_negotiation
lang_settings.set_cookie_always = portal_languages.set_cookie_everywhere # noqa
lang_settings.authenticated_users_only = portal_languages.authenticated_users_only # noqa
lang_settings.use_request_negotiation = portal_languages.use_request_negotiation # noqa
lang_settings.use_cctld_negotiation = portal_languages.use_cctld_negotiation # noqa
lang_settings.use_subdomain_negotiation = portal_languages.use_subdomain_negotiation # noqa
if hasattr(portal_languages, 'always_show_selector'):
lang_settings.always_show_selector = portal_languages.always_show_selector
lang_settings.always_show_selector = portal_languages.always_show_selector # noqa

# Remove the old tool
portal.manage_delObjects('portal_languages')
Expand Down
14 changes: 14 additions & 0 deletions plone/app/upgrade/v50/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -270,4 +270,18 @@
handler=".final.to501"
/>
</gs:upgradeSteps>

<gs:upgradeSteps
source="5012"
destination="5013"
profile="Products.CMFPlone:plone">

<gs:upgradeStep
title="Run to502 upgrade profile."
description=""
handler=".final.to502"
/>

</gs:upgradeSteps>

</configure>
11 changes: 9 additions & 2 deletions plone/app/upgrade/v50/final.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
from plone.app.upgrade.utils import loadMigrationProfile
from plone.dexterity.interfaces import IDexterityContent
from plone.registry.interfaces import IRegistry
from Products.CMFCore.utils import getToolByName
from Products.CMFPlone.utils import safe_unicode
Expand Down Expand Up @@ -65,7 +64,6 @@ def refresh_getIcon_catalog_metadata(context):
logger.info('`getIcon` not in metadata, skip upgrade step')
return


cnt = 0
# search whole catalog
for brain in zcatalog.unrestrictedSearchResults():
Expand All @@ -83,3 +81,12 @@ def refresh_getIcon_catalog_metadata(context):
logger.info('Reindexed `getIcon` for %s items' % str(cnt))

refresh_getIcon_catalog_metadata(context)


def to502(context):
"""5.0.1 -> 5.0.2"""

# When migrating from Plone 4.3 to 5.0 the profile-version of
# plone.app.querystring is 13 at this point but the upgrade-step
# upgrade_to_5 has not been run. Let's run it.
loadMigrationProfile(context, 'profile-plone.app.querystring:upgrade_to_5')

0 comments on commit 3bcedea

Please sign in to comment.