Commit da7e0f0b authored by Vincent Pelletier's avatar Vincent Pelletier

SQLCatalog_deferFullTextIndex{,Activity}: Do not use getObject .

getObject is generally a shortcut for "return self", and on brains for
traversing to corresponding document.
Except... Not everywhere. portal_catalog for example defines a completely
unrelated method which takes a UID as argument and does a query retrieving
one document. Which is basically totally redundant with its __call__
method. Still, of course, it is used in several places.
Also, ERP5Form.Report defines yet another getObject method, taking an
acquisition context as argument and traversing to some other path.

So do not use getObject (at least until the code recovers some sanity and
consistency), but getPath + custom activity API. Oh well.
parent b41dc8e0
# This script is called to defer fulltext indexing in a lower priority.
GROUP_METHOD_ID = context.getPath() + '/SQLCatalog_deferFullTextIndexActivity'
for document_value, root_document_path in zip(getObject, getRootDocumentPath):
document_value.activate(
activateObject = context.getPortalObject().portal_activities.activateObject
for document, root_document_path in zip(getPath, getRootDocumentPath):
activateObject(
document,
activity='SQLQueue',
priority=4,
group_method_id=GROUP_METHOD_ID,
......
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>getObject, getRootDocumentPath</string> </value>
<value> <string>getPath, getRootDocumentPath</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......
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