Commit d0bc2315 authored by Boxiang Sun's avatar Boxiang Sun Committed by Eteri

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 0de2e060
......@@ -12,6 +12,8 @@
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")
.declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("notifyChange", "notifyChange")
.allowPublicAcquisition("redirect", function (param_list) {
var gadget = this;
return gadget.redirect({command: 'change', options: {
......@@ -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) {
var gadget = this,
view;
......
......@@ -238,7 +238,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.303.21710.19063</string> </value>
<value> <string>962.26853.29747.36369</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -256,7 +256,7 @@
</tuple>
<state>
<tuple>
<float>1504186995.81</float>
<float>1506672340.09</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -34,6 +34,7 @@ support_request.edit(
support_request.submit()
support_request.immediateReindexObject()
# create an HTML Post
if description or file is not None:
......@@ -61,8 +62,6 @@ if description or file is not None:
post.publish()
post.immediateReindexObject()
support_request.immediateReindexObject()
return support_request.Base_redirect('officejs_support_request_view',
keep_items={
'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