Skip to content

fix(caldav): use direct.edit route in event activities #52410

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
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 @@ -95,11 +95,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 @@ -110,7 +106,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 @@ -177,11 +173,7 @@ public static function generateObjectParameterLinkEncodingDataProvider(): array
/** @dataProvider generateObjectParameterLinkEncodingDataProvider */
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 @@ -191,7 +183,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