Commit c7117afa authored by Boxiang Sun's avatar Boxiang Sun Committed by Tristan Cavelier

erp5_officejs_support_request_ui: Fast input dialog submmitting fixing.

- Reindex the support request before add it as HTML Post follow up.
- Use custome message when no post content provided.
This should fix the 502 Proxy error and 400 error when creating a
 new Support Request with/without description.
parent 9a84ef83
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment") .declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")
.declareAcquiredMethod("redirect", "redirect") .declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("getSetting", "getSetting") .declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("notifyChange", "notifyChange")
.allowPublicAcquisition("redirect", function (param_list) { .allowPublicAcquisition("redirect", function (param_list) {
var gadget = this; var gadget = this;
return gadget.redirect({command: 'change', options: { return gadget.redirect({command: 'change', options: {
...@@ -24,6 +26,12 @@ ...@@ -24,6 +26,12 @@
} }
}); });
}) })
.allowPublicAcquisition("notifyChange", function (param_list) {
if (param_list[0]) {
return this.notifyChange("Please provide a description for this support request.");
}
return this.notifyChange(param_list[0]);
})
.declareMethod('render', function (options) { .declareMethod('render', function (options) {
var gadget = this, var gadget = this,
view; view;
......
...@@ -238,7 +238,7 @@ ...@@ -238,7 +238,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>961.303.21710.19063</string> </value> <value> <string>962.26853.29747.36369</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -256,7 +256,7 @@ ...@@ -256,7 +256,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1504186995.81</float> <float>1506672340.09</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -34,6 +34,7 @@ support_request.edit( ...@@ -34,6 +34,7 @@ support_request.edit(
support_request.submit() support_request.submit()
support_request.immediateReindexObject()
# create an HTML Post # create an HTML Post
if description or file is not None: if description or file is not None:
...@@ -61,8 +62,6 @@ if description or file is not None: ...@@ -61,8 +62,6 @@ if description or file is not None:
post.publish() post.publish()
post.immediateReindexObject() post.immediateReindexObject()
support_request.immediateReindexObject()
return support_request.Base_redirect('officejs_support_request_view', return support_request.Base_redirect('officejs_support_request_view',
keep_items={ keep_items={
'portal_status_message': portal.Base_translateString( 'portal_status_message': portal.Base_translateString(
......
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