diff --git a/CHANGES.rst b/CHANGES.rst index f8fb67fc..254a86c6 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,7 +5,8 @@ Changelog 5.1.17 (unreleased) ------------------- -- Nothing changed yet. +- Re-launch 5800 upgrade-step for already created folders because there were some missing ids. + [cekk] 5.1.16 (2024-09-20) diff --git a/src/design/plone/contenttypes/profiles/default/metadata.xml b/src/design/plone/contenttypes/profiles/default/metadata.xml index 53723b84..82fb03c9 100644 --- a/src/design/plone/contenttypes/profiles/default/metadata.xml +++ b/src/design/plone/contenttypes/profiles/default/metadata.xml @@ -1,6 +1,6 @@ - 5800 + 5900 profile-redturtle.bandi:default profile-collective.venue:default diff --git a/src/design/plone/contenttypes/upgrades/configure.zcml b/src/design/plone/contenttypes/upgrades/configure.zcml index 4c85a05b..2a21a367 100644 --- a/src/design/plone/contenttypes/upgrades/configure.zcml +++ b/src/design/plone/contenttypes/upgrades/configure.zcml @@ -613,4 +613,14 @@ handler=".upgrades.to_5800" /> + + + diff --git a/src/design/plone/contenttypes/upgrades/upgrades.py b/src/design/plone/contenttypes/upgrades/upgrades.py index 597a2624..d4b2d896 100644 --- a/src/design/plone/contenttypes/upgrades/upgrades.py +++ b/src/design/plone/contenttypes/upgrades/upgrades.py @@ -1068,3 +1068,20 @@ def to_5800(context): catalog = api.portal.get_tool(name="portal_catalog") catalog.manage_reindexIndex(ids=["exclude_from_search"]) + + +def to_5900(context): + """ + Re-launch 5800 upgrade to already created folders, because there were some missing ids + """ + for id, pt in [ + ("sponsor_evento", "Document"), + ("documenti", "Document"), + ("documenti-allegati", "Document"), + ("modulistica", "Document"), + ]: # ... + brains = api.content.find(getId=id, portal_type=pt) + for brain in brains: + obj = brain.getObject() + obj.exclude_from_search = True + obj.reindexObject(idxs=["exclude_from_search"])