I downloaded the demo of spring from the official website, and found two problems after running it:
-
The file name cannot be changed. After closing the document and opening it again, the old file name is still the same, and the local file name has not changed.
-
The version cannot be rolled back. I added the code as shown in the picture according to the guidance of the document, and the rollback button appeared, but it didn’t work.
Here is the full code:
config.events['onRequestRename'] = onRequestRename;
config.events['onRequestRestore'] = function (event) {
console.log(event)
docEditor.refreshHistory(JSON.parse(hist));
};
var onRequestRename = function(event) { // the user is trying to rename file by clicking Rename... button
innerAlert("onRequestRename: " + JSON.stringify(event.data));
var newfilename = event.data;
var data = {
newfilename: newfilename,
dockey: config.document.key,
ext: config.document.fileType
};
let xhr = new XMLHttpRequest();
xhr.open("POST", "rename");
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.send(JSON.stringify(data));
xhr.onload = function () {
innerAlert(xhr.responseText);
}
The back-end code for file rename is not screenshotted, because the code in the official demo is completely used.
The docker log reports an error, but this error seems to have nothing to do with the problem:
2023-08-24T13:36:50.347599064Z 2023/08/24 13:36:50 [error] 7317#7317: *351 open() "/var/www/onlyoffice/documentserver/web-apps/vendor/socketio/socket.io.min.js.map" failed (2: No such file or directory), client: 192.168.1.100, server: , request: "GET /7.4.0-163/web-apps/vendor/socketio/socket.io.min.js.map HTTP/1.1", host: "192.168.1.100:5678"
2023-08-24T13:36:58.060146231Z 2023/08/24 13:36:58 [error] 7317#7317: *351 open() "/var/www/onlyoffice/documentserver/web-apps/vendor/socketio/socket.io.min.js.map" failed (2: No such file or directory), client: 192.168.1.100, server: , request: "GET /7.4.0-163/web-apps/vendor/socketio/socket.io.min.js.map HTTP/1.1", host: "192.168.1.100:5678"
2023-08-24T13:37:17.409463025Z 2023/08/24 13:37:17 [error] 7317#7317: *351 open() "/var/www/onlyoffice/documentserver/web-apps/vendor/socketio/socket.io.min.js.map" failed (2: No such file or directory), client: 192.168.1.100, server: , request: "GET /7.4.0-163/web-apps/vendor/socketio/socket.io.min.js.map HTTP/1.1", host: "192.168.1.100:5678"
Other functions are fine. I like the product of onlyoffice very much. Please help me to find out if this is a bug or what I did wrong, thanks!
Document Server version: 7.4.0.163
Type of installation of the Document Server (docker, deb/rpm, exe)
OS: docker
Browser version: Chrome-116.0.5845.110