Skip to content

fix: add event link#8123

Open
hamza221 wants to merge 1 commit intomainfrom
fix/event-link
Open

fix: add event link#8123
hamza221 wants to merge 1 commit intomainfrom
fix/event-link

Conversation

@hamza221
Copy link
Copy Markdown
Contributor

@hamza221 hamza221 commented Apr 1, 2026

add a way to share a permanent link to an event
image

ps: Set as a fix intentionally so it can be backported

@hamza221 hamza221 added 3. to review Waiting for reviews enhancement New feature request labels Apr 8, 2026
@hamza221 hamza221 requested a review from mejo- April 8, 2026 13:05
@hamza221 hamza221 marked this pull request as ready for review April 8, 2026 13:05
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 8, 2026

Codecov Report

❌ Patch coverage is 0% with 18 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/mixins/EditorMixin.js 0.00% 14 Missing and 4 partials ⚠️

📢 Thoughts on this report? Let us know!

Comment on lines +64 to +87
foreach ($calendars as $calendar) {
if (method_exists($calendar, 'isDeleted') && $calendar->isDeleted()) {
continue;
}

$results = $calendar->search('', [], ['uid' => $uid], 1);
if (!empty($results)) {
$result = $results[0];
$objectUri = $result['uri'];
$calendarUri = $calendar->getUri();

// Construct the DAV path that matches what the frontend uses for objectId
$davPath = '/remote.php/dav/calendars/' . $this->userId . '/' . $calendarUri . '/' . $objectUri;
$objectId = base64_encode($davPath);

$editRecurrenceId = $recurrenceId ?? 'next';

return new RedirectResponse(
$this->urlGenerator->linkToRoute('calendar.view.indexdirect.edit.recurrenceId', [
'objectId' => $objectId,
'recurrenceId' => $editRecurrenceId,
])
);
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be maybe moved to a service, so it can be reused by #8048

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be helpful indeed 😊

Signed-off-by: Hamza <hamzamahjoubi221@gmail.com>
@hamza221
Copy link
Copy Markdown
Contributor Author

hamza221 commented Apr 8, 2026

Also wondering if we should implement a method to search by event UID

Comment thread appinfo/routes.php
Comment on lines +17 to +19
// Events
['name' => 'event#index', 'url' => '/event/{uid}', 'verb' => 'GET', 'postfix' => 'event.uid'],
['name' => 'event#index', 'url' => '/event/{uid}/{recurrenceId}', 'verb' => 'GET', 'postfix' => 'event.uid.recurrenceId'],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would make this a generic route "/object/{uid}" or something like that, this way this can be used for both Events and Tasks

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also can we use the new route attributes instead of the routes file?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I never worked with tasks, would they also use the same logic to resolve/ redirect ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, VTODO (tasks) are identical for the most part to a VEVENT, they have a UID and a RECURRANCE-ID, the main differences are VTODO does not have a DTEND it uses a DUE and DURATION.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, I'll update it then

Comment on lines +47 to +48
* @NoAdminRequired
* @NoCSRFRequired
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the new route attributes

private CalendarInitialStateService $calendarInitialStateService,
private IManager $calendarManager,
private IURLGenerator $urlGenerator,
private ?string $userId,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a userSession

Comment on lines +55 to +58
if ($this->userId === null) {
$this->calendarInitialStateService->run();
return new TemplateResponse($this->appName, 'main');
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews enhancement New feature request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants