From 9da6ac7715ac309f029e21f40287814b81a78f94 Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 22 Dec 2025 11:11:02 -0500 Subject: [PATCH 1/6] fix: Load DAV plugins via SabrePluginAddEvent Signed-off-by: Josh --- lib/AppInfo/Application.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index e2a10e475..877af3891 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -10,6 +10,7 @@ use OCA\Circles\Events\CircleDestroyedEvent; use OCA\DAV\Connector\Sabre\Principal; +use OCA\DAV\Events\SabrePluginAddEvent; use OCA\Files\Event\LoadAdditionalScriptsEvent; use OCA\Files_Sharing\Event\BeforeTemplateRenderedEvent; use OCA\Files_Trashbin\Expiration; @@ -26,9 +27,11 @@ use OCA\GroupFolders\Command\ExpireGroup\ExpireGroupVersions; use OCA\GroupFolders\Command\ExpireGroup\ExpireGroupVersionsTrash; use OCA\GroupFolders\Folder\FolderManager; +use OCA\GroupFolders\Listeners\ACLPluginListener; use OCA\GroupFolders\Listeners\CircleDestroyedEventListener; use OCA\GroupFolders\Listeners\LoadAdditionalScriptsListener; use OCA\GroupFolders\Listeners\NodeRenamedListener; +use OCA\GroupFolders\Listeners\PropFindPluginListener; use OCA\GroupFolders\Mount\FolderStorageManager; use OCA\GroupFolders\Mount\MountProvider; use OCA\GroupFolders\Trash\TrashBackend; @@ -78,6 +81,8 @@ public function register(IRegistrationContext $context): void { $context->registerEventListener(BeforeTemplateRenderedEvent::class, LoadAdditionalScriptsListener::class); $context->registerEventListener(CircleDestroyedEvent::class, CircleDestroyedEventListener::class); $context->registerEventListener(NodeRenamedEvent::class, NodeRenamedListener::class); + $context->registerEventListener(SabrePluginAddEvent::class, ACLPluginListener::class); + $context->registerEventListener(SabrePluginAddEvent::class, PropFindPluginListener::class); $context->registerService(MountProvider::class, function (ContainerInterface $c): MountProvider { /** @var IAppConfig $config */ From 6e52d1b28d367de6f8d54f3c6f2d8741fa34b103 Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 22 Dec 2025 11:20:15 -0500 Subject: [PATCH 2/6] chore: Add ACLPluginListener to handle SabrePluginAddEvent Signed-off-by: Josh --- lib/Listeners/ACLPluginListener.php | 50 +++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 lib/Listeners/ACLPluginListener.php diff --git a/lib/Listeners/ACLPluginListener.php b/lib/Listeners/ACLPluginListener.php new file mode 100644 index 000000000..c31c899c3 --- /dev/null +++ b/lib/Listeners/ACLPluginListener.php @@ -0,0 +1,50 @@ + + */ +class ACLPluginListener implements IEventListener { + public function __construct( + private RuleManager $ruleManager, + private IUserSession $userSession, + private FolderManager $folderManager, + private IEventDispatcher $eventDispatcher, + private ACLManagerFactory $aclManagerFactory, + private IL10N $l10n, + ) { + } + + public function handle(Event $event): void { + if (!$event instanceof SabrePluginAddEvent) { + return; + } + $event->getServer()->addPlugin(new ACLPlugin( + $this->ruleManager, + $this->userSession, + $this->folderManager, + $this->eventDispatcher, + $this->aclManagerFactory, + $this->l10n + )); + } +} From db16faca881798a3b547f08cb5727b682cf2aac6 Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 22 Dec 2025 11:21:36 -0500 Subject: [PATCH 3/6] chore: Add PropFindPluginListener class for event handling Signed-off-by: Josh --- lib/Listeners/PropFindPluginListener.php | 38 ++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 lib/Listeners/PropFindPluginListener.php diff --git a/lib/Listeners/PropFindPluginListener.php b/lib/Listeners/PropFindPluginListener.php new file mode 100644 index 000000000..243f0c2c2 --- /dev/null +++ b/lib/Listeners/PropFindPluginListener.php @@ -0,0 +1,38 @@ + + */ +class PropFindPluginListener implements IEventListener { + public function __construct( + private IRootFolder $rootFolder, + private IUserSession $userSession, + ) { + } + + public function handle(Event $event): void { + if (!$event instanceof SabrePluginAddEvent) { + return; + } + $event->getServer()->addPlugin(new PropFindPlugin( + $this->rootFolder, + $this->userSession + )); + } +} From 220387adcfdbcd9113e619941968f6b440f7634e Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 22 Dec 2025 11:24:03 -0500 Subject: [PATCH 4/6] chore: drop legacy method of loading sabre plugins from info.xml Replaced with event listeners Signed-off-by: Josh --- appinfo/info.xml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/appinfo/info.xml b/appinfo/info.xml index c720ab88d..e2406c8b3 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -76,10 +76,6 @@ OCA\GroupFolders\DAV\RootCollection - - OCA\GroupFolders\DAV\PropFindPlugin - OCA\GroupFolders\DAV\ACLPlugin - From ea0b780728eaff6484709fc6d3714923756ce5d8 Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 22 Dec 2025 12:41:45 -0500 Subject: [PATCH 5/6] chore: Add SabrePluginAddEvent stub class Signed-off-by: Josh --- psalm.xml | 1 + .../oca_dav_events_sabreplugaddevent.php | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 tests/stubs/oca_dav_events_sabreplugaddevent.php diff --git a/psalm.xml b/psalm.xml index 54a6f6d26..0355b77d6 100644 --- a/psalm.xml +++ b/psalm.xml @@ -85,6 +85,7 @@ + diff --git a/tests/stubs/oca_dav_events_sabreplugaddevent.php b/tests/stubs/oca_dav_events_sabreplugaddevent.php new file mode 100644 index 000000000..454d42fad --- /dev/null +++ b/tests/stubs/oca_dav_events_sabreplugaddevent.php @@ -0,0 +1,20 @@ + Date: Tue, 23 Dec 2025 10:48:44 -0500 Subject: [PATCH 6/6] fix: lock psalm workflow version to PHP to 8.2 temporarily Signed-off-by: Josh --- .github/workflows/psalm.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/psalm.yml b/.github/workflows/psalm.yml index 9a0d2efef..33cc7f9ba 100644 --- a/.github/workflows/psalm.yml +++ b/.github/workflows/psalm.yml @@ -38,7 +38,8 @@ jobs: - name: Set up php${{ steps.versions.outputs.php-available }} uses: shivammathur/setup-php@0f7f1d08e3e32076e51cae65eb0b0c871405b16e # v2.34.1 with: - php-version: ${{ steps.versions.outputs.php-available }} + # php-version: ${{ steps.versions.outputs.php-available }} + php-version: '8.2' extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite coverage: none ini-file: development