diff --git a/last_commit.txt b/last_commit.txt index 8b95e128f5..4a2fce0b01 100644 --- a/last_commit.txt +++ b/last_commit.txt @@ -2,49 +2,123 @@ Repository: plone.app.upgrade Branch: refs/heads/master -Date: 2015-09-11T12:37:52+02:00 -Author: Philip Bauer (pbauer) -Commit: https://github.com/plone/plone.app.upgrade/commit/04b20c96cb06d336bdd9ef130cd5de3a60b59d8e +Date: 2015-09-11T11:51:20-04:00 +Author: esteele (esteele) +Commit: https://github.com/plone/plone.app.upgrade/commit/6dcb359379f6faa928fd1e89ac2dbab686fb5255 -Fix migration of types_not_searched to registry +Migrate login settings to the configuration registry. Files changed: -M CHANGES.rst -M plone/app/upgrade/v50/alphas.py - -diff --git a/CHANGES.rst b/CHANGES.rst -index bbd7a69..ca4a222 100644 ---- a/CHANGES.rst -+++ b/CHANGES.rst -@@ -4,6 +4,10 @@ Changelog - 1.3.15 (unreleased) - ------------------- +M plone/app/upgrade/v50/betas.py +M plone/app/upgrade/v50/profiles/to_rc2/registry.xml + +diff --git a/plone/app/upgrade/v50/betas.py b/plone/app/upgrade/v50/betas.py +index 969777b..4f3590f 100644 +--- a/plone/app/upgrade/v50/betas.py ++++ b/plone/app/upgrade/v50/betas.py +@@ -414,10 +414,27 @@ def to50rc2(context): + # Migrate settings from portal_properties to the configuration registry + pprop = getToolByName(portal, 'portal_properties') + site_properties = pprop['site_properties'] ++ registry = getUtility(IRegistry) -+- Fix migration of types_not_searched to registry. -+ Fixes https://github.com/plone/plone.app.contenttypes/issues/268 -+ [pbauer] + if site_properties.hasProperty('search_results_description_length'): +- registry = getUtility(IRegistry) + settings = registry.forInterface(ISearchSchema, prefix='plone') + value = site_properties.getProperty( + 'search_results_description_length', 160) + settings.search_results_description_length = value + - - Remove site properties that have been migrated to the registry. - [esteele] - -diff --git a/plone/app/upgrade/v50/alphas.py b/plone/app/upgrade/v50/alphas.py -index ecb55f9..4e76980 100644 ---- a/plone/app/upgrade/v50/alphas.py -+++ b/plone/app/upgrade/v50/alphas.py -@@ -282,7 +282,7 @@ def upgrade_search_controlpanel_settings(context): - settings.enable_livesearch = site_properties.enable_livesearch - settings.types_not_searched = tuple([ - t for t in types_tool.listContentTypes() -- if t not in site_properties.types_not_searched and -+ if t in site_properties.types_not_searched and - t not in BAD_TYPES - ]) ++ properties_to_migrate = ['auth_cookie_length', ++ 'verify_login_name', ++ 'external_login_url', ++ 'external_logout_url', ++ 'external_login_iframe'] ++ for p in properties_to_migrate: ++ if site_properties.hasProperty(p): ++ value = site_properties.getProperty(p) ++ registry['plone.%s' % p] = value ++ site_properties._delProperty(p) ++ ++ if site_properties.hasProperty('allow_external_login_sites'): ++ value = site_properties.get('allow_external_login_sites') ++ if value is not None: ++ registry['plone.allow_external_login_sites'] = tuple(value) ++ site_properties._delProperty('allow_external_login_sites') +diff --git a/plone/app/upgrade/v50/profiles/to_rc2/registry.xml b/plone/app/upgrade/v50/profiles/to_rc2/registry.xml +index 1b93620..4f6b077 100644 +--- a/plone/app/upgrade/v50/profiles/to_rc2/registry.xml ++++ b/plone/app/upgrade/v50/profiles/to_rc2/registry.xml +@@ -4,4 +4,6 @@ + prefix="plone" /> + ++ + +\ No newline at end of file + + +Repository: plone.app.upgrade + + +Branch: refs/heads/master +Date: 2015-09-11T15:06:51-04:00 +Author: Eric Steele (esteele) +Commit: https://github.com/plone/plone.app.upgrade/commit/5fef01cd1052653e99c86d8b8c2db437b84f19d1 + +Merge pull request #49 from plone/login_settings_migration + +Migrate login settings to the configuration registry. + +Files changed: +M plone/app/upgrade/v50/betas.py +M plone/app/upgrade/v50/profiles/to_rc2/registry.xml + +diff --git a/plone/app/upgrade/v50/betas.py b/plone/app/upgrade/v50/betas.py +index 969777b..4f3590f 100644 +--- a/plone/app/upgrade/v50/betas.py ++++ b/plone/app/upgrade/v50/betas.py +@@ -414,10 +414,27 @@ def to50rc2(context): + # Migrate settings from portal_properties to the configuration registry + pprop = getToolByName(portal, 'portal_properties') + site_properties = pprop['site_properties'] ++ registry = getUtility(IRegistry) -@@ -314,4 +314,3 @@ def upgrade_site_controlpanel_settings(context): - settings.enable_sitemap = site_properties.enable_sitemap - if site_properties.hasProperty('exposeDCMetaTags'): - settings.exposeDCMetaTags = site_properties.exposeDCMetaTags -- + if site_properties.hasProperty('search_results_description_length'): +- registry = getUtility(IRegistry) + settings = registry.forInterface(ISearchSchema, prefix='plone') + value = site_properties.getProperty( + 'search_results_description_length', 160) + settings.search_results_description_length = value ++ ++ properties_to_migrate = ['auth_cookie_length', ++ 'verify_login_name', ++ 'external_login_url', ++ 'external_logout_url', ++ 'external_login_iframe'] ++ for p in properties_to_migrate: ++ if site_properties.hasProperty(p): ++ value = site_properties.getProperty(p) ++ registry['plone.%s' % p] = value ++ site_properties._delProperty(p) ++ ++ if site_properties.hasProperty('allow_external_login_sites'): ++ value = site_properties.get('allow_external_login_sites') ++ if value is not None: ++ registry['plone.allow_external_login_sites'] = tuple(value) ++ site_properties._delProperty('allow_external_login_sites') +diff --git a/plone/app/upgrade/v50/profiles/to_rc2/registry.xml b/plone/app/upgrade/v50/profiles/to_rc2/registry.xml +index 1b93620..4f6b077 100644 +--- a/plone/app/upgrade/v50/profiles/to_rc2/registry.xml ++++ b/plone/app/upgrade/v50/profiles/to_rc2/registry.xml +@@ -4,4 +4,6 @@ + prefix="plone" /> + ++ + \ No newline at end of file