Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(caldav): use direct.edit route in event activities
Signed-off-by: Richard Steinmetz <[email protected]>
  • Loading branch information
st3iny authored and AndyScherzinger committed Jun 1, 2025
commit 696d76f976f6bb5f1f80ca826db80528717b8f62
9 changes: 2 additions & 7 deletions apps/dav/lib/CalDAV/Activity/Provider/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,9 @@ protected function generateObjectParameter(array $eventData, string $affectedUse
// as seen from the affected user.
$objectId = base64_encode($this->url->getWebroot() . '/remote.php/dav/calendars/' . $affectedUser . '/' . $calendarUri . '_shared_by_' . $linkData['owner'] . '/' . $linkData['object_uri']);
}
$link = [
'view' => 'dayGridMonth',
'timeRange' => 'now',
'mode' => 'sidebar',
$params['link'] = $this->url->linkToRouteAbsolute('calendar.view.indexdirect.edit', [
'objectId' => $objectId,
'recurrenceId' => 'next'
];
$params['link'] = $this->url->linkToRouteAbsolute('calendar.view.indexview.timerange.edit', $link);
]);
} catch (\Exception $error) {
// Do nothing
}
Expand Down
12 changes: 2 additions & 10 deletions apps/dav/tests/unit/CalDAV/Activity/Provider/EventTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,7 @@ public function testGenerateObjectParameter(int $id, string $name, ?array $link,
if ($link) {
$affectedUser = $link['owner'];
$generatedLink = [
'view' => 'dayGridMonth',
'timeRange' => 'now',
'mode' => 'sidebar',
'objectId' => base64_encode('/remote.php/dav/calendars/' . $link['owner'] . '/' . $link['calendar_uri'] . '/' . $link['object_uri']),
'recurrenceId' => 'next'
];
$this->appManager->expects($this->once())
->method('isEnabledForUser')
Expand All @@ -90,7 +86,7 @@ public function testGenerateObjectParameter(int $id, string $name, ?array $link,
->method('getWebroot');
$this->url->expects($this->once())
->method('linkToRouteAbsolute')
->with('calendar.view.indexview.timerange.edit', $generatedLink)
->with('calendar.view.indexdirect.edit', $generatedLink)
->willReturn('fullLink');
}
}
Expand Down Expand Up @@ -159,11 +155,7 @@ public static function generateObjectParameterLinkEncodingDataProvider(): array
*/
public function testGenerateObjectParameterLinkEncoding(array $link, string $objectId): void {
$generatedLink = [
'view' => 'dayGridMonth',
'timeRange' => 'now',
'mode' => 'sidebar',
'objectId' => $objectId,
'recurrenceId' => 'next'
];
$this->appManager->expects($this->once())
->method('isEnabledForUser')
Expand All @@ -173,7 +165,7 @@ public function testGenerateObjectParameterLinkEncoding(array $link, string $obj
->method('getWebroot');
$this->url->expects($this->once())
->method('linkToRouteAbsolute')
->with('calendar.view.indexview.timerange.edit', $generatedLink)
->with('calendar.view.indexdirect.edit', $generatedLink)
->willReturn('fullLink');
$objectParameter = ['id' => 42, 'name' => 'calendar', 'link' => $link];
$result = [
Expand Down
Loading