Conversation
| <value_type type="plone.registry.field.TextLine" /> | ||
| </field> | ||
| <value> | ||
| <element>intfield</element> |
There was a problem hiding this comment.
This looks like a project individual value. The default in the package is empty, so I would initialize it empty here too.
| @@ -0,0 +1,4 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | |||
| <metadata> | |||
| <version>13</version> | |||
There was a problem hiding this comment.
Update profiles do not need a metadata.xml file.
| <value_type type="plone.registry.field.TextLine" /> | ||
| </field> | ||
| <value> | ||
| <element>intfield</element> |
There was a problem hiding this comment.
Same as above -> empty initialization per default
|
|
||
| reapply_profile(context) | ||
|
|
||
| def upgrade_registry_13(context): |
There was a problem hiding this comment.
If you only want to reload an existing import_step I'd not do this in python code but in zcml see my change suggestion below.
| <genericsetup:upgradeStep | ||
| title="collective.collectionfilter: Upgrade v12 to v13" | ||
| description="upgrade to version 13" | ||
| source="12" | ||
| destination="13" | ||
| profile="collective.collectionfilter:upgrade-13" | ||
| handler=".upgrades.upgrade_registry_13" | ||
| /> | ||
|
|
There was a problem hiding this comment.
| <genericsetup:upgradeStep | |
| title="collective.collectionfilter: Upgrade v12 to v13" | |
| description="upgrade to version 13" | |
| source="12" | |
| destination="13" | |
| profile="collective.collectionfilter:upgrade-13" | |
| handler=".upgrades.upgrade_registry_13" | |
| /> | |
| <genericsetup:upgradeDepends | |
| title="collective.collectionfilter: Upgrade v12 to v13" | |
| description="upgrade to version 13" | |
| source="12" | |
| destination="13" | |
| profile="collective.collectionfilter:default" | |
| import_profile="collective.collectionfilter:upgrade-13" | |
| /> | |
And the registration of the upgrade profile collective.collectionfilter:upgrade-13 is missing in configure.zcml
| INTEGER_IDXS = plone.api.portal.get_registry_record( | ||
| "collective.collectionfilter.int_types", default=[] | ||
| ) | ||
| except ComponentLookupError: |
There was a problem hiding this comment.
I thought registry lookup errors are handled in plone.api ... and please follow the suggestion of the docs:
Always import the top-level package (from plone import api) and then use the module namespace to access the method you want (portal = api.portal.get()).
See https://6.docs.plone.org/plone.api/about.html#design-decisions
|
Additionally I suggest to implement the other globals also as registry configurable values. Best implementation would be to add an ICollectionFilterSettings schema interface with the configurable fields and load this interface in |
|
Close. @petschki already outlined a better approach (full ICollectionFilterSettings schema). Capture the broader idea in a new issue if desired. |
Added int field used in vocabulary to registry settings.
Not sure how it is best to do the upgrade profile.
I usually use another 'folder' in profiles, but looks like you do it differently.