otetard / ownpad

Ownpad is a Nextcloud application that allows to create and open Etherpad and Ethercalc documents.
GNU Affero General Public License v3.0
57 stars 24 forks source link

Error on Nextcloud 25: "Class \"OCP\\App\" not found" #119

Closed real34 closed 1 year ago

real34 commented 1 year ago

Hi,

The extension is throwing the following error when trying to open a pad file (etherpad) after an upgrade to Nextcloud 25.

Nextcloud docker image for reproduction: nextcloud:25.0.1

{
    "reqId": "RrZJDYaPR8zDLuDJ7G6Z",
    "level": 3,
    "time": "2022-11-05T19:12:36+00:00",
    "remoteAddr": "xxxx",
    "user": "xxxxx",
    "app": "index",
    "method": "GET",
    "url": "/index.php/apps/ownpad/?file=2022.11.09%20-%20r%C3%A9union.pad&dir=%2FUNE%2F*contenus%2F01%20-%20CR%20R%C3%A9unions%2F2022",
    "message": "Class \"OCP\\App\" not found",
    "userAgent": "Mozilla/5.0 (X11; Linux x86_64; rv:106.0) Gecko/20100101 Firefox/106.0",
    "version": "25.0.1.1",
    "exception": {
        "Exception": "Error",
        "Message": "Class \"OCP\\App\" not found",
        "Code": 0,
        "Trace": [
            {
                "file": "/var/www/html/lib/private/Template/Base.php",
                "line": 180,
                "function": "include"
            },
            {
                "file": "/var/www/html/lib/private/Template/Base.php",
                "line": 150,
                "function": "load",
                "class": "OC\\Template\\Base",
                "type": "->",
                "args": [
                    "/var/www/html/apps/ownpad/templates/viewer.php",
                    [
                        {
                            "__class__": "OC\\URLGenerator",
                            "userSession": {
                                "__class__": "OC\\User\\Session"
                            }
                        },
                        "https://xxxxx/p/4i8ticsz7jnzma7j",
                        "2022.11.09 - réunion.pad"
                    ]
                ]
            },
            {
                "file": "/var/www/html/lib/private/legacy/OC_Template.php",
                "line": 181,
                "function": "fetchPage",
                "class": "OC\\Template\\Base",
                "type": "->",
                "args": [
                    [
                        {
                            "__class__": "OC\\URLGenerator",
                            "userSession": {
                                "__class__": "OC\\User\\Session"
                            }
                        },
                        "https://xxxxxxxx/p/4i8ticsz7jnzma7j",
                        "2022.11.09 - réunion.pad"
                    ]
                ]
            },
            {
                "file": "/var/www/html/lib/public/AppFramework/Http/TemplateResponse.php",
                "line": 213,
                "function": "fetchPage",
                "class": "OC_Template",
                "type": "->",
                "args": [
                    [
                        {
                            "__class__": "OC\\URLGenerator",
                            "userSession": {
                                "__class__": "OC\\User\\Session"
                            }
                        },
                        "https://xxxxxxx/p/4i8ticsz7jnzma7j",
                        "2022.11.09 - réunion.pad"
                    ]
                ]
            },
            {
                "file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
                "line": 178,
                "function": "render",
                "class": "OCP\\AppFramework\\Http\\TemplateResponse",
                "type": "->",
                "args": []
            },
            {
                "file": "/var/www/html/lib/private/AppFramework/App.php",
                "line": 172,
                "function": "dispatch",
                "class": "OC\\AppFramework\\Http\\Dispatcher",
                "type": "->",
                "args": [
                    {
                        "__class__": "OCA\\Ownpad\\Controller\\DisplayController"
                    },
                    "showPad"
                ]
            },
            {
                "file": "/var/www/html/lib/private/Route/Router.php",
                "line": 298,
                "function": "main",
                "class": "OC\\AppFramework\\App",
                "type": "::",
                "args": [
                    "OCA\\Ownpad\\Controller\\DisplayController",
                    "showPad",
                    {
                        "__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
                    },
                    [
                        "ownpad.display.showPad"
                    ]
                ]
            },
            {
                "file": "/var/www/html/lib/base.php",
                "line": 1047,
                "function": "match",
                "class": "OC\\Route\\Router",
                "type": "->",
                "args": [
                    "/apps/ownpad/"
                ]
            },
            {
                "file": "/var/www/html/index.php",
                "line": 36,
                "function": "handleRequest",
                "class": "OC",
                "type": "::",
                "args": []
            }
        ],
        "File": "/var/www/html/apps/ownpad/templates/viewer.php",
        "Line": 5,
        "CustomMessage": "--"
    }
}
otetard commented 1 year ago

This issue was fixed in f3ce28525f75b8f6478a2350f17387c2656798e6 which will be included in the next release

otetard commented 1 year ago

This issue should be fixed in Ownpad 0.7.0. Thanks for the feedback!

real34 commented 1 year ago

Thanks for the fix! It can now be enabled on my instance, however I have a weird behavior when creating a new pad: it is created at the root directory for the current user.

Since it might be a Nextcloud 25 (or 0.7.0) only issue I mention it here. I haven't found any similar issues on the bugtracker yet. Let me know if you prefer that I open a new one.

To reproduce: in a directory, create a new pad What happens:

Expected:

Demo:

https://user-images.githubusercontent.com/75968/201534708-0c93632e-35cb-4852-9be9-00741e14a0f4.mp4