Skip to content

Commit

Permalink
Avoid acquisition problem in *onModify* event handler: now try to rei…
Browse files Browse the repository at this point in the history
…ndex children only if context is folderish (#284)
  • Loading branch information
cekk authored Oct 11, 2024
1 parent 7827f97 commit 449f720
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Changelog
6.2.20 (unreleased)
-------------------

- Nothing changed yet.

- Avoid acquisition problem in *onModify* event handler: now try to reindex children only if context is folderish.
[cekk]

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

0 comments on commit 449f720

Please sign in to comment.