Commit 3a4b7040 authored by Klaus Wölfel's avatar Klaus Wölfel Committed by Klaus Wölfel

[erp5_officejs] Fix error when converting new document with remote storage

In only office apps and notebook app download convert gadget produces error
when trying to convert a new document when using erp5 storage because it
redirects to the document with old jio_key which does not exist anymore
after syncing. The bug is fixed by introducing a cloudooo_only parameter
in ojs_sync gadget which is used to only sync cloudooo storage.
parent 263dabd9
...@@ -26,7 +26,9 @@ ...@@ -26,7 +26,9 @@
} }
}) })
.push(function () { .push(function () {
if (!gadget.state.cloudooo_only) {
return gadget.repair(); return gadget.repair();
}
}) })
.push(function () { .push(function () {
if (gadget.state.redirect) { if (gadget.state.redirect) {
...@@ -47,7 +49,8 @@ ...@@ -47,7 +49,8 @@
return gadget.changeState({ return gadget.changeState({
auto_repair: options.auto_repair, auto_repair: options.auto_repair,
redirect: options.redirect, redirect: options.redirect,
cloudooo: result && true cloudooo: result && true,
cloudooo_only: options.cloudooo_only
}); });
}); });
}) })
......
...@@ -242,7 +242,7 @@ ...@@ -242,7 +242,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>969.42224.7621.358</string> </value> <value> <string>978.61273.2319.54766</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -260,7 +260,7 @@ ...@@ -260,7 +260,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1534757989.87</float> <float>1570356085.27</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
// declared methods // declared methods
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
.declareMethod("getConvertedBlob", function (options) { .declareMethod("getConvertedBlob", function (options) {
var gadget = this; var gadget = this, redirect;
return gadget.getSetting('file_extension') return gadget.getSetting('file_extension')
.push(function (file_extension) { .push(function (file_extension) {
if (file_extension === options.format) { if (file_extension === options.format) {
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
'options': { 'options': {
'page': 'ojs_sync', 'page': 'ojs_sync',
'auto_repair': true, 'auto_repair': true,
'cloudooo_only': true,
'redirect': options.redirect 'redirect': options.redirect
} }
}); });
...@@ -67,6 +68,7 @@ ...@@ -67,6 +68,7 @@
'options': { 'options': {
'page': 'ojs_sync', 'page': 'ojs_sync',
'auto_repair': true, 'auto_repair': true,
'cloudooo_only': true,
'redirect': options.redirect 'redirect': options.redirect
} }
}); });
......
...@@ -269,7 +269,7 @@ ...@@ -269,7 +269,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>969.46486.51629.28689</string> </value> <value> <string>978.61280.24884.63385</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -287,7 +287,7 @@ ...@@ -287,7 +287,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1534770737.04</float> <float>1570356626.41</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
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