nextcloud / welcome

Welcome widget in Nextcloud's dashboard
GNU Affero General Public License v3.0
17 stars 11 forks source link

App crashing Nextcloud "syntax error, unexpected ')', expecting variable (T_VARIABLE)" #27

Closed jeltevdw closed 1 year ago

jeltevdw commented 1 year ago

App is crashing Nextcloud due to syntax error "syntax error, unexpected ')', expecting variable (T_VARIABLE)"

In file /opt/nextcloud/apps/welcome/lib/Listener/CSPListener.php, line 44

public function __construct(IRequest $request,
                            FileService $fileService,
) {

The extra comma after FileService $fileService should be removed. Introduced in commit b2de09bc55ecbab0264399cd9aa58c9288a74e46

{ "reqId":"v57RIBkMvwROS1kjgxOb", "level":3, "time":"2022-12-25T16:57:29+00:00", "remoteAddr":"", "user":"", "app":"index", "method":"GET", "url":"/apps/dashboard/", "message":"syntax error, unexpected ')', expecting variable (T_VARIABLE)", "userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15", "version":"23.0.12.2", "exception":{ "Exception":"ParseError", "Message":"syntax error, unexpected ')', expecting variable (T_VARIABLE)", "Code":0, "Trace":[ { "file":"/opt/nextcloud/lib/composer/composer/ClassLoader.php", "line":428, "function":"Composer\Autoload\includeFile" }, { "function":"loadClass", "class":"Composer\Autoload\ClassLoader", "type":"->" }, { "function":"spl_autoload_call" }, { "file":"/opt/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php", "line":112, "function":"construct", "class":"ReflectionClass", "type":"->" }, { "file":"/opt/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php", "line":131, "function":"resolve", "class":"OC\AppFramework\Utility\SimpleContainer", "type":"->" }, { "file":"/opt/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php", "line":463, "function":"query", "class":"OC\AppFramework\Utility\SimpleContainer", "type":"->" }, { "file":"/opt/nextcloud/lib/private/ServerContainer.php", "line":145, "function":"queryNoFallback", "class":"OC\AppFramework\DependencyInjection\DIContainer", "type":"->" }, { "file":"/opt/nextcloud/lib/private/EventDispatcher/ServiceEventListener.php", "line":71, "function":"query", "class":"OC\ServerContainer", "type":"->" }, { "file":"/opt/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php", "line":251, "function":"invoke", "class":"OC\EventDispatcher\ServiceEventListener", "type":"->" }, { "file":"/opt/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php", "line":73, "function":"callListeners", "class":"Symfony\Component\EventDispatcher\EventDispatcher", "type":"->" }, { "file":"/opt/nextcloud/lib/private/EventDispatcher/EventDispatcher.php", "line":88, "function":"dispatch", "class":"Symfony\Component\EventDispatcher\EventDispatcher", "type":"->" }, { "file":"/opt/nextcloud/lib/private/EventDispatcher/EventDispatcher.php", "line":100, "function":"dispatch", "class":"OC\EventDispatcher\EventDispatcher", "type":"->" }, { "file":"/opt/nextcloud/lib/private/Security/CSP/ContentSecurityPolicyManager.php", "line":60, "function":"dispatchTyped", "class":"OC\EventDispatcher\EventDispatcher", "type":"->" }, { "file":"/opt/nextcloud/lib/private/AppFramework/Middleware/Security/CSPMiddleware.php", "line":71, "function":"getDefaultPolicy", "class":"OC\Security\CSP\ContentSecurityPolicyManager", "type":"->" }, { "file":"/opt/nextcloud/lib/private/AppFramework/Middleware/MiddlewareDispatcher.php", "line":143, "function":"afterController", "class":"OC\AppFramework\Middleware\Security\CSPMiddleware", "type":"->" }, { "file":"/opt/nextcloud/lib/private/AppFramework/Http/Dispatcher.php", "line":164, "function":"afterController", "class":"OC\AppFramework\Middleware\MiddlewareDispatcher", "type":"->" }, { "file":"/opt/nextcloud/lib/private/AppFramework/App.php", "line":157, "function":"dispatch", "class":"OC\AppFramework\Http\Dispatcher", "type":"->" }, { "file":"/opt/nextcloud/lib/private/Route/Router.php", "line":302, "function":"main", "class":"OC\AppFramework\App", "type":"::" }, { "file":"/opt/nextcloud/lib/base.php", "line":1015, "function":"match", "class":"OC\Route\Router", "type":"->" }, { "file":"/opt/nextcloud/index.php", "line":36, "function":"handleRequest", "class":"OC", "type":"::" } ], "File":"/opt/nextcloud/apps/welcome/lib/Listener/CSPListener.php", "Line":44, "CustomMessage":"--" }

julien-nc commented 1 year ago

Thanks for the bug report.

Didn't catch that one as it's fine with Php >= 8.0.

v1.0.4 should be fine. Could you confirm?

jeltevdw commented 1 year ago

Thanks for the bug report.

Didn't catch that one as it's fine with Php >= 8.0.

v1.0.4 should be fine. Could you confirm?

Fixed in v1.0.4 on php 7.4. Thanks for the quick response.