Commit ba9a1418 authored by Vincent Pelletier's avatar Vincent Pelletier

Revert "erp5_officejs_support_request, erp5_post: Pass follow-up by value"

This reverts commit c49cf8d8.
Callee is directly accessed from other places, so changing this API is
wrong.
This it not immediately visible in tests, but this makes
erp5_officejs_support_request_ui_test:testFunctionalSupportRequest
testCheckComment test randomly fail (apparently because the javascript
error message may appear after or before the test final step is
satisfied - which means this tests is bugged, but that's a separate
issue).
parent 9676ad20
follow_up_value.edit() # update modification date follow_up_object, = context.getPortalObject().portal_catalog(relative_url=follow_up, limit=1)
follow_up_object.edit() # update modification date
post = context.PostModule_createHTMLPostFromText( post = context.PostModule_createHTMLPostFromText(
follow_up_value=follow_up_value, follow_up=follow_up,
data=data, data=data,
) )
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>follow_up_value, predecessor, data, file</string> </value> <value> <string>follow_up, predecessor, data, file</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -38,7 +38,7 @@ support_request.immediateReindexObject() ...@@ -38,7 +38,7 @@ support_request.immediateReindexObject()
if description is not None or file is not None: if description is not None or file is not None:
portal.post_module.PostModule_createHTMLPostForSupportRequest( portal.post_module.PostModule_createHTMLPostForSupportRequest(
follow_up_value=support_request, follow_up=support_request.getRelativeUrl(), # XXX give support_request as follow_up_value
predecessor=None, predecessor=None,
data="" if description is None else description, data="" if description is None else description,
file=file, file=file,
......
...@@ -3,10 +3,14 @@ portal = context.getPortalObject() ...@@ -3,10 +3,14 @@ portal = context.getPortalObject()
# create an HTML Post # create an HTML Post
post_module = portal.post_module post_module = portal.post_module
# get the related object
follow_up_object, = portal.portal_catalog(relative_url=follow_up, limit=2)
follow_up_object = follow_up_object.getObject()
now = DateTime() now = DateTime()
post_edit_kw = { post_edit_kw = {
"start_date": now, "start_date": now,
"follow_up_value": follow_up_value, "follow_up_value": follow_up_object,
"text_content": data, "text_content": data,
} }
if predecessor is not None: if predecessor is not None:
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>follow_up_value, data, predecessor=None</string> </value> <value> <string>follow_up, data, predecessor=None</string> </value>
</item> </item>
<item> <item>
<key> <string>_proxy_roles</string> </key> <key> <string>_proxy_roles</string> </key>
......
return context.PostModule_createHTMLPost( return context.PostModule_createHTMLPost(
follow_up_value=follow_up_value, follow_up=follow_up,
predecessor=predecessor, predecessor=predecessor,
data="<p>" + data.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;").replace(" ", " &nbsp;").replace("\n", "<br/>") + "</p>", data="<p>" + data.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;").replace(" ", " &nbsp;").replace("\n", "<br/>") + "</p>",
) )
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>follow_up_value, data, predecessor=None</string> </value> <value> <string>follow_up, data, predecessor=None</string> </value>
</item> </item>
<item> <item>
<key> <string>_proxy_roles</string> </key> <key> <string>_proxy_roles</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