Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error in site syndication settings when upgrading. #318

Merged
merged 2 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions news/315.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix error in site syndication settings when upgrading.
[maurits]
11 changes: 10 additions & 1 deletion plone/app/upgrade/v60/final.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,18 @@ def fix_tinymce_menubar(context):
record.value = value

def fix_syndication_settings(context):
"""Fix Syndication Setting in the registry
"""Fix Syndication Setting in the registry
Products.CMFPlone.interfaces.syndication.ISiteSyndicationSettings
is moved to plone.base.interfaces.syndication.ISiteSyndicationSettings.

See https://github.com/plone/Products.CMFPlone/issues/3805
"""
try:
from plone.base.interfaces.syndication import ISiteSyndicationSettings
except ImportError:
# Upgrade step called from older Plone version?
return

registry = getUtility(IRegistry)
record_keys = list(registry.records.keys())
portal_catalog = getToolByName(context,'portal_catalog')
Expand All @@ -171,6 +177,9 @@ def fix_syndication_settings(context):
"show_syndication_link"
]

# Make sure the interface is registered
registry.registerInterface(ISiteSyndicationSettings)

# write old record values to new record
for fieldname in fieldnames:
old_key = f"{old_iface}.{fieldname}"
Expand Down