diff --git a/CHANGES.rst b/CHANGES.rst index a3f666ab..de9a0648 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -7,6 +7,10 @@ Changelog - Fix upgrade step [lucabel] +- Avoid acquisition problem in *onModify* event handler: now try to reindex children only if context is folderish. + [cekk] +- Add sort_on sortable_title to event_location, uo_location, ufficio_responsabile vocabularies + [lucabel] 6.2.19 (2024-09-23) ------------------- diff --git a/src/design/plone/contenttypes/events/common.py b/src/design/plone/contenttypes/events/common.py index 0d1268c3..8eb82ddb 100644 --- a/src/design/plone/contenttypes/events/common.py +++ b/src/design/plone/contenttypes/events/common.py @@ -199,8 +199,12 @@ def onModify(context, event): if "IBasic.title" in getattr( description, "attributes", [] ) or "IDublinCore.title" in getattr(description, "attributes", []): - for child in context.listFolderContents(): - child.reindexObject(idxs=["parent"]) + context_state = api.content.get_view( + name="plone_context_state", context=context, request=context.REQUEST + ) + if context_state.is_folderish(): + for child in context.listFolderContents(): + child.reindexObject(idxs=["parent"]) def createSubfolders(context, event): diff --git a/src/design/plone/contenttypes/vocabularies/reference_vocabularies.py b/src/design/plone/contenttypes/vocabularies/reference_vocabularies.py index bfa2ef40..bab3cdeb 100644 --- a/src/design/plone/contenttypes/vocabularies/reference_vocabularies.py +++ b/src/design/plone/contenttypes/vocabularies/reference_vocabularies.py @@ -28,7 +28,7 @@ def __call__(self, registry=None): if self.catalog is None: return SimpleVocabulary([]) values = self.get_all_index_values() - brains = self.catalog(UID=values) + brains = self.catalog(UID=values, sort_on="sortable_title") terms = [] for brain in brains: terms.append(SimpleTerm(brain.UID, brain.UID, safe_text(brain.Title)))