diff --git a/CHANGES.md b/CHANGES.md index 05cf0d867..00191cc99 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,7 +4,7 @@ Changelog 3.2.1 (unreleased) ------------------ -- Nothing changed yet. +- restrict full content querylisting display to specific content types 3.2.0 (2026-03-30) diff --git a/castle/cms/upgrades/__init__.py b/castle/cms/upgrades/__init__.py index d266153f6..1e6ba4c0d 100644 --- a/castle/cms/upgrades/__init__.py +++ b/castle/cms/upgrades/__init__.py @@ -7,7 +7,7 @@ from Products.CMFPlone.resources.browser.cook import cookWhenChangingSettings from Products.CMFCore.utils import getToolByName from zope.interface import noLongerProvides -from OFS.interfaces import IItem +import transaction import plone.api as api @@ -150,6 +150,15 @@ def upgrade_3011(site, logger=CASTLE_LOGGER): upgrade_3020a = default_upgrade_factory('3020') def upgrade_3020b(context): catalog = getToolByName(context, 'portal_catalog') - for brain in catalog(): + + for i, brain in enumerate(catalog( + portal_type=['Document', 'Folder', 'News Item', 'Event']) + ): obj = brain.getObject() + richtext = getattr(obj, 'text', None) + if not richtext: + continue catalog.catalog_object(obj, idxs=[]) + if i % 10 == 0: + transaction.commit() + transaction.commit()