fix(dav): allow ExternalCalendar as schedule-default-calendar-URL#61602
Open
stephan1827 wants to merge 1 commit into
Open
fix(dav): allow ExternalCalendar as schedule-default-calendar-URL#61602stephan1827 wants to merge 1 commit into
stephan1827 wants to merge 1 commit into
Conversation
When a user tries to set an ExternalCalendar (e.g. from integration_davc) as the default calendar for scheduling, CustomPropertiesBackend::validateProperty() rejects it with 'No such calendar' because it only accepts instances of OCA\DAV\CalDAV\Calendar, not OCA\DAV\CalDAV\Integration\ExternalCalendar. ExternalCalendar is already imported in the file but was unused in the instanceof check. Extend the validation to also accept ExternalCalendar nodes, running a simplified check (VEVENT support only) since these calendars are always writable and cannot be subscriptions, shared, or deleted. Signed-off-by: stephan1827 <stephan@stricker.cloud>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When a user sets an
ExternalCalendar(e.g. a calendar provided by a third-party app viaOCA\DAV\CalDAV\Integration\ExternalCalendar) as the default calendar for scheduling,CustomPropertiesBackend::validateProperty()rejects it with a "No such calendar" exception. This surfaces to the user as "Standardkalender konnte nicht gespeichert werden" in the Nextcloud Calendar widget.Root cause: The
validateProperty()method for{urn:ietf:params:xml:ns:caldav}schedule-default-calendar-URLchecks$node instanceof Calendar(i.e.OCA\DAV\CalDAV\Calendar).ExternalCalendaris a sibling class — it does not extendCalendar— so the check always fails for any app-generated calendar.Notably,
ExternalCalendaris already imported in the file (line 17) but was not used in the validation check.Changes
instanceofcheck to also acceptExternalCalendarnodes.Calendarnodes the existingDefaultCalendarValidatorpath runs unchanged.ExternalCalendarnodes a simplified check runs: verify that the calendar reports VEVENT support. The subscription/canWrite/isShared/isDeleted checks are skipped becauseExternalCalendardoes not expose those methods — and semantically, app-generated calendars are always the current user's own writable collections.How to reproduce
ExternalCalendar(e.g.integration_davc)After this fix the PROPPATCH succeeds and the setting is saved.
Test plan
ExternalCalendar-based calendar as the default scheduling calendar in the Calendar widget settingsCalendaras default still works correctly