Skip to content

Commit b0bd5d0

Browse files
authored
Fix catalog query in analysis category modified handler (#1882)
* Fix catalog query in analysiscategory modified handler * Changelog updated
1 parent 17ba512 commit b0bd5d0

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

CHANGES.rst

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Changelog
44
2.0.1 (unreleased)
55
------------------
66

7+
- #1882 Fix catalog query in analysis category modified handler
78
- #1878 Fix two dimension results parser for Analyses containing a dash in the name
89
- #1876 Hide contents listing for dexterity containers
910
- #1872 Upgrade/migrate catalogs and remove dependency to TextindexNG3

src/bika/lims/subscribers/objectmodified.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,18 @@ def ObjectModifiedEventHandler(obj, event):
6161
elif obj.portal_type == 'AnalysisCategory':
6262
# If the analysis category's Title is modified, we must
6363
# re-index all services and analyses that refer to this title.
64+
uid = obj.UID()
6465

6566
# re-index all analysis services
66-
query = dict(getCategoryUID=obj.UID())
67+
query = dict(category_uid=uid, portal_type="AnalysisService")
6768
brains = api.search(query, SETUP_CATALOG)
6869
for brain in brains:
6970
obj = api.get_object(brain)
70-
obj.reindexObject(idxs=['getCategoryTitle'])
71+
obj.reindexObject()
7172

7273
# re-index analyses
73-
query = dict(getCategoryUID=obj.UID())
74+
query = dict(getCategoryUID=uid)
7475
brains = api.search(query, ANALYSIS_CATALOG)
7576
for brain in brains:
7677
obj = api.get_object(brain)
77-
obj.reindexObject(idxs=['getCategoryTitle'])
78+
obj.reindexObject()

0 commit comments

Comments
 (0)