Commit b33d461d authored by Vincent Pelletier's avatar Vincent Pelletier

ERP5Catalog.CatalogTool: Allow select_method_id to change result length.

Otherwise, longer results would be truncated and shorter results would
produce activities with an empty list as argument.
parent 464f65bf
......@@ -1080,7 +1080,7 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
activity='SQLQueue', **activate_kw)
r = getattr(portal_activities, select_method_id)(r)
activate = getattr(active_portal_activities, method_id)
for i in xrange(0, result_count, packet_size):
for i in xrange(0, len(r), packet_size):
activate(r[i:i+packet_size], *method_args, **method_kw)
else:
kw = activate_kw.copy()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment