Skip to content

fix(dav): allow ExternalCalendar as schedule-default-calendar-URL#61602

Open
stephan1827 wants to merge 1 commit into
nextcloud:masterfrom
stephan1827:fix/external-calendar-schedule-default
Open

fix(dav): allow ExternalCalendar as schedule-default-calendar-URL#61602
stephan1827 wants to merge 1 commit into
nextcloud:masterfrom
stephan1827:fix/external-calendar-schedule-default

Conversation

@stephan1827

Copy link
Copy Markdown

Summary

When a user sets an ExternalCalendar (e.g. a calendar provided by a third-party app via OCA\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-URL checks $node instanceof Calendar (i.e. OCA\DAV\CalDAV\Calendar). ExternalCalendar is a sibling class — it does not extend Calendar — so the check always fails for any app-generated calendar.

Notably, ExternalCalendar is already imported in the file (line 17) but was not used in the validation check.

Changes

  • Extend the instanceof check to also accept ExternalCalendar nodes.
  • For Calendar nodes the existing DefaultCalendarValidator path runs unchanged.
  • For ExternalCalendar nodes a simplified check runs: verify that the calendar reports VEVENT support. The subscription/canWrite/isShared/isDeleted checks are skipped because ExternalCalendar does not expose those methods — and semantically, app-generated calendars are always the current user's own writable collections.

How to reproduce

  1. Install an app that provides calendars via ExternalCalendar (e.g. integration_davc)
  2. In the Nextcloud Calendar widget settings, attempt to set one of those calendars as the default calendar
  3. Observe the error "Standardkalender konnte nicht gespeichert werden" (default calendar could not be saved)

After this fix the PROPPATCH succeeds and the setting is saved.

Test plan

  • Set an ExternalCalendar-based calendar as the default scheduling calendar in the Calendar widget settings
  • Verify the setting saves without error
  • Verify that setting a regular Calendar as default still works correctly
  • Verify that setting an unsupported node type still returns "No such calendar"

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>
@stephan1827 stephan1827 requested a review from a team as a code owner June 25, 2026 18:21
@stephan1827 stephan1827 requested review from ArtificialOwl, icewind1991, leftybournes and provokateurin and removed request for a team June 25, 2026 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant