ONLYOFFICE / DocumentServer

ONLYOFFICE Docs is a free collaborative online office suite comprising viewers and editors for texts, spreadsheets and presentations, forms and PDF, fully compatible with Office Open XML formats: .docx, .xlsx, .pptx and enabling collaborative editing in real time.
https://www.onlyoffice.com
GNU Affero General Public License v3.0
4.82k stars 1.08k forks source link

Endless load of Version History #789

Closed RuslanGabbasov closed 4 years ago

RuslanGabbasov commented 4 years ago

Do you want to request a feature or report a bug? need help

In documentation https://helpcenter.onlyoffice.com/ru/onlyoffice-editors/onlyoffice-document-editor/usageinstructions/viewdocinfo.aspx showed: image The panel that displays version and revision history. But we can't find any information describes a configuration of document server that makes it possible. In examples that represented on https://api.onlyoffice.com/editors/try, it doesn't work too.

Please help us. How it works and how we can enable it?

ShockwaveNN commented 4 years ago

Hi, you can get a view of this panel using onlyoffice-documentserver-ie or onlyoffice-documentserver-de integrated test example: image

Also documentation is here: https://api.onlyoffice.com/editors/history

RuslanGabbasov commented 4 years ago

Thank you for helping!

ShockwaveNN commented 4 years ago

I'll close this issue, feel free to ask any question or create new issue if anything happens )

RuslanGabbasov commented 4 years ago

Hi, @ShockwaveNN ! I have added two callback in configuration file:

        var onRequestHistory = function() {
            docEditor.refreshHistory({
                "currentVersion": 1,
                "history": [
                    {
                        "created": "2010-07-06 10:13 AM",
                        "key": "be87eb7ca44e5898964847a717aef440920175e86a34f4a9e78b0aa526d866b8",
                        "user": {
                            "id": "52",
                            "name": "Kate Cage"
                        },
                        "version": 1
                    },
                ]
            });
        };

        var onRequestHistoryData = function(event) {
            var version = event.data;
            docEditor.setHistoryData({
                "key": "be87eb7ca44e5898964847a717aef440920175e86a34f4a9e78b0aa526d866b8",
                "url": "https://example.com/url-to-example-document.docx",
                "version": version
            })
        };

And have added in config:

            "onRequestHistory": onRequestHistory,
            "onRequestHistoryData": onRequestHistoryData,

But when I click on History button I always get endless spinner: image

Browser console is empty, document server log is empty too. What I do wrong?

ShockwaveNN commented 4 years ago

@RuslanGabbasov Sorry, this is out of my area of knowledge. Maybe @LinneyS can help?

RuslanGabbasov commented 4 years ago

Sorry, it's my mistake. I figured out what was wrong.

ShockwaveNN commented 4 years ago

@RuslanGabbasov Could you describe your mistake if anyone notice same error?

RuslanGabbasov commented 4 years ago

Of course. In my case in the scope of onRequestHistory function wasn't docEditor object. But the error was caught in your code and didn't was shown.

ShockwaveNN commented 4 years ago

@RuslanGabbasov Ok, thanks, so if issue resolved - I'll close this issue. Feel free to comment here or create new if something happens

new-ranger commented 2 years ago

@RuslanGabbasov I am getting same error " loading version history" continuously coming. Could you plz describe what exactly issue was? What does mean scope of onRequestHistory function wasn't docEditor object?

RuslanGabbasov commented 2 years ago

@new-ranger It happened 2 years ago, and I hardly recall what was wrong. In my example just constant docEditor was undefined.

ShockwaveNN commented 2 years ago

@new-ranger I think you may get some other error with a similar look

I think it's better to create a new issue, check the JS console for error,s and add more info about your environment (os, DMS etc..)