Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
luca-bellenghi committed Oct 17, 2024
2 parents 564af27 + f1c4f86 commit 6b595ec
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
-------------------
Expand Down
8 changes: 6 additions & 2 deletions src/design/plone/contenttypes/events/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down

0 comments on commit 6b595ec

Please sign in to comment.