Skip to content

Commit

Permalink
Fix indexing of main dossier created from dossiertemplate.
Browse files Browse the repository at this point in the history
Because children are added to the main dossier with disabled indexing,
we need to reindex the main dossier after the reinabling indexing.
  • Loading branch information
Niklaus Johner committed Mar 24, 2021
1 parent b499ac1 commit 91c132d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/HISTORY.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Changelog
2021.7.0 (unreleased)
---------------------

- Fix catalog inconsistency when creating a dossier from a dossiertemplate. [njohner]
- Introduce customproperties default slots which is enabled for every document. [phgross]
- No longer fail during deployment if ldap is not in authentication plugins. [njohner]
- Add id field to the @listing endpoint. [elioschmutz]
Expand Down
3 changes: 3 additions & 0 deletions opengever/dossier/dossiertemplate/form.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ def create_dossier_content_from_template(self, container, template):
self.recursive_reindex(container)

def recursive_reindex(self, obj):
# because we have created objects inside the obj, we also
# need to reindex obj, not only its children.
obj.reindexObject()
for child_obj in obj.listFolderContents():
child_obj.reindexObject()

Expand Down

0 comments on commit 91c132d

Please sign in to comment.