Skip to content
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

Bug fix: Select the correct table based on CALENDAR_TYPE_CALENDAR #39553

Merged

Conversation

zero0cool0
Copy link
Contributor

@zero0cool0 zero0cool0 commented Jul 24, 2023

Summary

getChangesForCalendar always selects the calendars table but should select either calendars or calendarsubscriptions based on function argument calendarType.

@@ -2277,11 +2277,13 @@ public function getCalendarObjectById(string $principalUri, int $id): ?array {
* @return array
*/
public function getChangesForCalendar($calendarId, $syncToken, $syncLevel, $limit = null, $calendarType = self::CALENDAR_TYPE_CALENDAR) {
return $this->atomic(function () use ($calendarId, $syncToken, $syncLevel, $limit, $calendarType) {
$table = $calendarType === self::CALENDAR_TYPE_CALENDAR ? 'calendars': 'calendarsubscriptions';
Copy link
Member

Choose a reason for hiding this comment

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

suggestion: You can put this line directly into the callback function.

@tcitworld tcitworld added bug 3. to review Waiting for reviews feature: caldav Related to CalDAV internals labels Jul 24, 2023
@tcitworld tcitworld added this to the Nextcloud 28 milestone Jul 24, 2023
@joshtrichards
Copy link
Member

@zero0cool0 Please sign (DCO) your commit. The tests are failing on that. Click the red DCO fail link for details.

@zero0cool0 zero0cool0 force-pushed the fix/caldavbackend_getChangesForCalendar branch from e32b22a to a0ca75a Compare September 9, 2023 04:47
@ChristophWurst ChristophWurst force-pushed the fix/caldavbackend_getChangesForCalendar branch from 6f7e948 to cafd321 Compare September 28, 2023 07:28
@ChristophWurst ChristophWurst added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Sep 28, 2023
@ChristophWurst
Copy link
Member

/backport to stable27

@ChristophWurst
Copy link
Member

/backport to stable26

@skjnldsv skjnldsv mentioned this pull request Nov 1, 2023
This was referenced Nov 6, 2023
This was referenced Nov 14, 2023
@blizzz blizzz force-pushed the fix/caldavbackend_getChangesForCalendar branch from cafd321 to 3f164f6 Compare November 22, 2023 10:47
@blizzz blizzz modified the milestones: Nextcloud 28, Nextcloud 29 Nov 23, 2023
@skjnldsv skjnldsv force-pushed the fix/caldavbackend_getChangesForCalendar branch from 3f164f6 to 0f16153 Compare February 23, 2024 15:18
@skjnldsv skjnldsv merged commit 9eece36 into nextcloud:master Feb 23, 2024
151 of 158 checks passed

This comment was marked as resolved.

@skjnldsv
Copy link
Member

/backport to stable28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish bug feature: caldav Related to CalDAV internals
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants