Skip to content

Commit 696d76f

Browse files
st3inyAndyScherzinger
authored andcommitted
fix(caldav): use direct.edit route in event activities
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
1 parent d537769 commit 696d76f

File tree

2 files changed

+4
-17
lines changed

2 files changed

+4
-17
lines changed

apps/dav/lib/CalDAV/Activity/Provider/Event.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,9 @@ protected function generateObjectParameter(array $eventData, string $affectedUse
7878
// as seen from the affected user.
7979
$objectId = base64_encode($this->url->getWebroot() . '/remote.php/dav/calendars/' . $affectedUser . '/' . $calendarUri . '_shared_by_' . $linkData['owner'] . '/' . $linkData['object_uri']);
8080
}
81-
$link = [
82-
'view' => 'dayGridMonth',
83-
'timeRange' => 'now',
84-
'mode' => 'sidebar',
81+
$params['link'] = $this->url->linkToRouteAbsolute('calendar.view.indexdirect.edit', [
8582
'objectId' => $objectId,
86-
'recurrenceId' => 'next'
87-
];
88-
$params['link'] = $this->url->linkToRouteAbsolute('calendar.view.indexview.timerange.edit', $link);
83+
]);
8984
} catch (\Exception $error) {
9085
// Do nothing
9186
}

apps/dav/tests/unit/CalDAV/Activity/Provider/EventTest.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,7 @@ public function testGenerateObjectParameter(int $id, string $name, ?array $link,
7575
if ($link) {
7676
$affectedUser = $link['owner'];
7777
$generatedLink = [
78-
'view' => 'dayGridMonth',
79-
'timeRange' => 'now',
80-
'mode' => 'sidebar',
8178
'objectId' => base64_encode('/remote.php/dav/calendars/' . $link['owner'] . '/' . $link['calendar_uri'] . '/' . $link['object_uri']),
82-
'recurrenceId' => 'next'
8379
];
8480
$this->appManager->expects($this->once())
8581
->method('isEnabledForUser')
@@ -90,7 +86,7 @@ public function testGenerateObjectParameter(int $id, string $name, ?array $link,
9086
->method('getWebroot');
9187
$this->url->expects($this->once())
9288
->method('linkToRouteAbsolute')
93-
->with('calendar.view.indexview.timerange.edit', $generatedLink)
89+
->with('calendar.view.indexdirect.edit', $generatedLink)
9490
->willReturn('fullLink');
9591
}
9692
}
@@ -159,11 +155,7 @@ public static function generateObjectParameterLinkEncodingDataProvider(): array
159155
*/
160156
public function testGenerateObjectParameterLinkEncoding(array $link, string $objectId): void {
161157
$generatedLink = [
162-
'view' => 'dayGridMonth',
163-
'timeRange' => 'now',
164-
'mode' => 'sidebar',
165158
'objectId' => $objectId,
166-
'recurrenceId' => 'next'
167159
];
168160
$this->appManager->expects($this->once())
169161
->method('isEnabledForUser')
@@ -173,7 +165,7 @@ public function testGenerateObjectParameterLinkEncoding(array $link, string $obj
173165
->method('getWebroot');
174166
$this->url->expects($this->once())
175167
->method('linkToRouteAbsolute')
176-
->with('calendar.view.indexview.timerange.edit', $generatedLink)
168+
->with('calendar.view.indexdirect.edit', $generatedLink)
177169
->willReturn('fullLink');
178170
$objectParameter = ['id' => 42, 'name' => 'calendar', 'link' => $link];
179171
$result = [

0 commit comments

Comments
 (0)