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 @@
}
})
.push(function () {
return gadget.repair();
if (!gadget.state.cloudooo_only) {
  • The problem is that the document id where to redirect to does not exist anymore after sync because the new id is generated by erp5. So officejs cannot know this new id before sycing. In theory it would be possible to redirect to document list instead, but this would be very unfriendly for the user. The user expects to come back to the document he was editing or viewing after export. Also I think the change matches more what the user wants to do: only export when clicking on export, not export and sync with erp5.

  • It would also be nice to reproduce the issue in a test

  • It would also be nice to reproduce the issue in a test

    done in 57972349

    Edited by Klaus Wölfel
Please register or sign in to reply
return gadget.repair();
}
})
.push(function () {
if (gadget.state.redirect) {
......@@ -47,7 +49,8 @@
return gadget.changeState({
auto_repair: options.auto_repair,
redirect: options.redirect,
cloudooo: result && true
cloudooo: result && true,
cloudooo_only: options.cloudooo_only
});
});
})
......
......@@ -242,7 +242,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>969.42224.7621.358</string> </value>
<value> <string>978.61273.2319.54766</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>1534757989.87</float>
<float>1570356085.27</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -25,7 +25,7 @@
// declared methods
/////////////////////////////////////////////////////////////////
.declareMethod("getConvertedBlob", function (options) {
var gadget = this;
var gadget = this, redirect;
return gadget.getSetting('file_extension')
.push(function (file_extension) {
if (file_extension === options.format) {
......@@ -49,6 +49,7 @@
'options': {
'page': 'ojs_sync',
'auto_repair': true,
'cloudooo_only': true,
'redirect': options.redirect
}
});
......@@ -67,6 +68,7 @@
'options': {
'page': 'ojs_sync',
'auto_repair': true,
'cloudooo_only': true,
'redirect': options.redirect
}
});
......
......@@ -269,7 +269,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>969.46486.51629.28689</string> </value>
<value> <string>978.61280.24884.63385</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -287,7 +287,7 @@
</tuple>
<state>
<tuple>
<float>1534770737.04</float>
<float>1570356626.41</float>
<string>UTC</string>
</tuple>
</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