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: 2015-09-11T11:51:20-04:00
Author: esteele (esteele) <eric@esteele.net>
Commit: plone/plone.app.upgrade@6dcb359

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
Repository: plone.app.upgrade
Branch: refs/heads/master
Date: 2015-09-11T15:06:51-04:00
Author: Eric Steele (esteele) <eric@esteele.net>
Commit: plone/plone.app.upgrade@5fef01c

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
  • Loading branch information
esteele committed Sep 11, 2015
1 parent 5b0c725 commit 904727e
Showing 1 changed file with 111 additions and 37 deletions.
148 changes: 111 additions & 37 deletions last_commit.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,123 @@ Repository: plone.app.upgrade


Branch: refs/heads/master
Date: 2015-09-11T12:37:52+02:00
Author: Philip Bauer (pbauer) <bauer@starzel.de>
Commit: https://github.com/plone/plone.app.upgrade/commit/04b20c96cb06d336bdd9ef130cd5de3a60b59d8e
Date: 2015-09-11T11:51:20-04:00
Author: esteele (esteele) <eric@esteele.net>
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" />
<records interface="Products.CMFPlone.interfaces.ISearchSchema"
prefix="plone" />
+ <records interface="Products.CMFPlone.interfaces.ILoginSchema"
+ prefix="plone" />
</registry>
\ 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) <eric@esteele.net>
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" />
<records interface="Products.CMFPlone.interfaces.ISearchSchema"
prefix="plone" />
+ <records interface="Products.CMFPlone.interfaces.ILoginSchema"
+ prefix="plone" />
</registry>
\ No newline at end of file


0 comments on commit 904727e

Please sign in to comment.