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

App brokes Nextcloud on php 7.4 (debian bullseye) #132

Closed JohnXLivingston closed 10 months ago

JohnXLivingston commented 10 months ago

Hello,

This app breaks Nextcloud on servers using php7.4 (Debian Bullseye). This is due to an extra , here:

/srv/www/nextcloud/apps/ownpad/lib/Listeners/CSPListener.php line 26

class CSPListener implements IEventListener {
        /** @var IConfig */
        private $config;

        public function __construct(
                IConfig $config,
        ) {
                $this->config = $config;
        }

Should be:

class CSPListener implements IEventListener {
        /** @var IConfig */
        private $config;

        public function __construct(
                IConfig $config
        ) {
                $this->config = $config;
        }

The error:


{"exception":{"Exception":"ParseError","Message":"syntax error, unexpected ')', expecting variable (T_VARIABLE)",
"Code":0,
"Trace":[{"file":"/srv/www/nextcloud/lib/composer/composer/ClassLoader.php","line":428,"function":"Composer\\Autoload\\includeFile"},{"function":"loadClass","class":"Composer\\Autoload\\ClassLoader","type":"->"},{"function":"spl_autoload_call"},{"file":"/srv/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":114,"function":"__construct","class":"ReflectionClass","type":"->"},{"file":"/srv/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":134,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/srv/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":466,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/srv/www/nextcloud/lib/private/ServerContainer.php","line":145,"function":"queryNoFallback","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"file":"/srv/www/nextcloud/lib/private/EventDispatcher/ServiceEventListener.php","line":71,"function":"query","class":"OC\\ServerContainer","type":"->"},{"file":"/srv/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":251,"function":"__invoke","class":"OC\\EventDispatcher\\ServiceEventListener","type":"->"},{"file":"/srv/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":73,"function":"callListeners","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/srv/www/nextcloud/lib/private/EventDispatcher/EventDispatcher.php","line":88,"function":"dispatch","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/srv/www/nextcloud/lib/private/EventDispatcher/EventDispatcher.php","line":100,"function":"dispatch","class":"OC\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/srv/www/nextcloud/lib/private/Security/CSP/ContentSecurityPolicyManager.php","line":60,"function":"dispatchTyped","class":"OC\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/srv/www/nextcloud/lib/private/AppFramework/Middleware/Security/CSPMiddleware.php","line":71,"function":"getDefaultPolicy","class":"OC\\Security\\CSP\\ContentSecurityPolicyManager","type":"->"},{"file":"/srv/www/nextcloud/lib/private/AppFramework/Middleware/MiddlewareDispatcher.php","line":143,"function":"afterController","class":"OC\\AppFramework\\Middleware\\Security\\CSPMiddleware","type":"->"},{"file":"/srv/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":171,"function":"afterController","class":"OC\\AppFramework\\Middleware\\MiddlewareDispatcher","type":"->"},{"file":"/srv/www/nextcloud/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/srv/www/nextcloud/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/srv/www/nextcloud/lib/base.php","line":1053,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/srv/www/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/srv/www/nextcloud/apps/ownpad/lib/Listeners/CSPListener.php","Line":26,"CustomMessage":"--"}}
JohnXLivingston commented 10 months ago

Just found other similar errors. The above fix only repairs nextcloud globaly, but you still can't use the application.

This app should either be fixed, or marked incompatible with php <= 8.x

otetard commented 10 months ago

Thanks for the feedback. I’ll try to do a quickfix to also support PHP7.

JohnXLivingston commented 10 months ago

Thanks Olivier :)

otetard commented 10 months ago

Ownpad 0.9.5 should fix this issue. I’ve tested it with Nextcloud 25 and I’ve successfuly created public & private pads.

I’ve also fixed an issue with the size of pad names that was introduced in e68b1d903e8318edb61492e1f90fa9e49c971017

JohnXLivingston commented 10 months ago

Thanks!