nextcloud / files_fulltextsearch

🔍 Index the content of your files
GNU Affero General Public License v3.0
58 stars 30 forks source link

Latest release of groupfolders breaks GroupFoldersService.php #265

Closed nkinkade closed 3 weeks ago

nkinkade commented 4 weeks ago

The groupfolders app got a new release just a few hours ago, which apparently breaks this app. When groupfolders is updated, you get this error:

Too few arguments to function OCA\\GroupFolders\\Folder\\FolderManager::__construct(), 4 passed in /opt/nextcloud/apps/files_fulltextsearch/lib/Service/GroupFoldersService.php on line 67 and exactly 5 expected

It appears that the FolderManager now expects a 5th parameter of __construct() of type IEventDispatcher. The following patch appears to resolve the issue for me:

--- /opt/nextcloud/apps/files_fulltextsearch/lib/Service/GroupFoldersService.php    2024-08-16 17:26:55.935889984 +0000
+++ /opt/nextcloud/apps/files_fulltextsearch/lib/Service/GroupFoldersService.php.new    2024-08-16 17:26:29.906898303 +0000
@@ -38,6 +38,7 @@
 use OCA\Files_FullTextSearch\Tools\Traits\TArrayTools;
 use OCA\GroupFolders\Folder\FolderManager;
 use OCP\App\IAppManager;
+use OCP\EventDispatcher\IEventDispatcher;
 use OCP\Files\IMimeTypeLoader;
 use OCP\Files\Node;
 use OCP\FullTextSearch\Model\IIndex;
@@ -59,7 +60,8 @@
        private IGroupManager $groupManager,
        private LocalFilesService $localFilesService,
        ConfigService $configService,
-       private LoggerInterface $logger
+       private LoggerInterface $logger,
+       private IEventDispatcher $eventDispatcher
    ) {
        if ($configService->getAppValue(ConfigService::FILES_GROUP_FOLDERS) === '1'
            && $appManager->isEnabledForUser('groupfolders')) {
@@ -68,7 +70,8 @@
                    $dbConnection,
                    $groupManager,
                    $mimeTypeLoader,
-                   $logger
+                   $logger,
+                   $eventDispatcher
                );
            } catch (Exception $e) {
                return;
rinal13 commented 4 weeks ago

I added your patch, worked for me too by now

codejp3 commented 3 weeks ago

HUGE THANKS @nkinkade for this patch so quickly! Working like a charm.

The only thing I'd like to add is that generic error that showed in the log after updating and crashing NC: AH01071: Got error "Primary script unknown"

With 'debug' = true, set in the config file, it didn't reveal anything of great detail either.

Had me chasing around nginx/apache issues for a while until I reset the VM to yesterday's backup and replicated the issue by updating to 17.0.2 again.

julian70400 commented 3 weeks ago

Hey, 3 days ago we know this error, it break everything for everybody, why there is still not official patch ? It just brake my prod.

AndyScherzinger commented 3 weeks ago

Currently @sorbaugh and @ArtificialOwl are looking into it.

ArtificialOwl commented 3 weeks ago

Thanks @nkinkade for the report and the attached fix !