]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(caldav): add webroot to objectid for activities 40403/head
authorDaniel Kesselberg <mail@danielkesselberg.de>
Wed, 6 Sep 2023 15:48:21 +0000 (17:48 +0200)
committerDaniel <mail@danielkesselberg.de>
Mon, 18 Sep 2023 12:09:53 +0000 (14:09 +0200)
A calendar uri includes the webroot: example.com/cloud/remote.php/dav/calendars/alice/personal/
The calendar app uses base64(calendar uri) as identifier for calendar objects.

Without this patch the links from activity app to calendar app don't work for installations in a subdirectory.

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
apps/dav/lib/CalDAV/Activity/Provider/Event.php
apps/dav/tests/unit/CalDAV/Activity/Provider/EventTest.php

index 9ae04aadbba36ec7d5764c4198877f1bf2669bd1..13f0036b0b03227646d0ef4bbe3958a79c62a5dc 100644 (file)
@@ -97,7 +97,7 @@ class Event extends Base {
                                // The calendar app needs to be manually loaded for the routes to be loaded
                                OC_App::loadApp('calendar');
                                $linkData = $eventData['link'];
-                               $objectId = base64_encode('/remote.php/dav/calendars/' . $linkData['owner'] . '/' . $linkData['calendar_uri'] . '/' . $linkData['object_uri']);
+                               $objectId = base64_encode($this->url->getWebroot() . '/remote.php/dav/calendars/' . $linkData['owner'] . '/' . $linkData['calendar_uri'] . '/' . $linkData['object_uri']);
                                $link = [
                                        'view' => 'dayGridMonth',
                                        'timeRange' => 'now',
index 583ac6ca725d037b18ea6e1850aea3e9de2371f0..253e1628229773b7a17113798937ae076651f3e6 100644 (file)
@@ -121,6 +121,8 @@ class EventTest extends TestCase {
                                ->with('calendar')
                                ->willReturn($calendarAppEnabled);
                        if ($calendarAppEnabled) {
+                               $this->url->expects($this->once())
+                                       ->method('getWebroot');
                                $this->url->expects($this->once())
                                        ->method('linkToRouteAbsolute')
                                        ->with('calendar.view.indexview.timerange.edit', $generatedLink)