Permalink
Browse files

Add profile for supporting new style collections.

In the upgrade step and the default profile we apply this too.
We take care not to fail here on Plone 4.0 or 4.1, as the registry is not needed there.
  • Loading branch information...
1 parent c06d4bf commit a1294790885b11c8766d658b70cf15c01878ce6c @mauritsvanrees mauritsvanrees committed Dec 21, 2012
View
@@ -4,7 +4,9 @@ History of feedfeeder
2.1 (unreleased)
----------------
-- Support our criterion in new style collections.
+- Support our criterion in new style collections. Add new profile for
+ this. Make sure not to fail on Plone 4.0 or 4.1 where this is not
+ needed at all.
[maurits]
- Update feed folder after its creation
@@ -38,6 +38,15 @@
for="Products.CMFPlone.interfaces.IPloneSiteRoot"
/>
+ <genericsetup:registerProfile
+ name="registry"
+ title="Feedfeeder registry"
+ directory="profiles/registry"
+ description="Profile for registry settings of Feedfeeder"
+ provides="Products.GenericSetup.interfaces.EXTENSION"
+ for="Products.CMFPlone.interfaces.IPloneSiteRoot"
+ />
+
<genericsetup:upgradeStep
title="Update the portal types"
description=""
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<metadata>
+ <version>1000</version>
+</metadata>
@@ -2,6 +2,10 @@
# The default profile id of your package:
PROFILE_ID = 'profile-Products.feedfeeder:default'
+# The profile id for the registry. Done because on Plone 4.1 you get
+# an ImportError when trying to store a value for
+# plone.app.querystring.
+REGISTRY_PROFILE_ID = 'profile-Products.feedfeeder:registry'
def update_types(context):
@@ -13,11 +17,15 @@ def update_actions(context):
def update_registry(context):
+ # context could be portal_setup or the Plone Site.
+ portal_setup = getToolByName(context, 'portal_setup')
try:
- context.runImportStepFromProfile(PROFILE_ID, 'plone.app.registry')
- except ValueError:
- # Probably Plone 3, which has no registry, and needs no
- # registry in this case.
+ portal_setup.runImportStepFromProfile(
+ REGISTRY_PROFILE_ID, 'plone.app.registry')
+ except (ValueError, ImportError):
+ # Probably Plone 4.0, which has no plone.app.registry, or
+ # Plone 4.1, which has no plone.app.querystring. None of
+ # these two actually needs the registry settings in that case.
pass
@@ -49,4 +57,5 @@ def importVarious(context):
logger = context.getLogger('feedfeeder')
site = context.getSite()
add_indexes(site, logger)
+ update_registry(site)
logger.info('feedfeeder_various step imported')
View
@@ -94,6 +94,7 @@ want update them all once you can do::
host localhost:8080
</clock-server>
+
Dependencies
------------
@@ -103,6 +104,17 @@ If you use Plone 3, please use a Products.feedfeeder version from the
2.0 line. The current latest is 2.0.9.
+Upgrade notes
+-------------
+
+If you have installed Products.feedfeeder 2.1.x in Plone 4.0 or 4.1
+and you upgrade to Plone 4.2 or higher, then you will be missing some
+functionality for listing or ordering feedfeeder items in new style
+collections. To solve this, you should go to ``portal_setup`` in the
+Zope Management Interface, visit the Import tab, select the
+"Feedfeeder registry" profile and import all steps.
+
+
Tests
-----

0 comments on commit a129479

Please sign in to comment.