nextcloud / nextcloud/server

[Bug]: Federated calendar without calendar-color property triggers PHP warning in FederatedCalendarImpl

Open Beginner friendly
#59,587 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

Bug description

When an incoming federated calendar is rendered and the federated calendar info does not contain the Apple iCal calendar-color property, Nextcloud logs a PHP warning instead of handling the missing value gracefully.

Observed warning:

{
  "app": "PHP",
  "message": "Undefined array key \"{http://apple.com/ns/ical/}calendar-color\" at /var/www/nextcloud/apps/dav/lib/CalDAV/Federation/FederatedCalendarImpl.php#39"
}
Steps to reproduce
  1. Set up two federated Nextcloud instances.
  2. Share a calendar from instance A to a user on instance B.
  3. Open the dashboard or another view on instance B that loads the federated calendar metadata.
  4. Check nextcloud.log on instance B.
Expected behavior

Missing calendar-color data should be handled gracefully, for example by returning null or a default/fallback color without logging a PHP warning.

Actual behavior

A PHP warning is logged because FederatedCalendarImpl reads the '{http://apple.com/ns/ical/}calendar-color' array key unconditionally.

Environment
  • Nextcloud Server: 33.0.2.2
  • Calendar app: 6.2.2
  • PHP: 8.4
  • OS: Debian 13
  • Web server: Nginx
Additional information

From local debugging on the affected instance, the federated calendar data passed into FederatedCalendarImpl can exist without the '{http://apple.com/ns/ical/}calendar-color' key, but FederatedCalendarImpl::getDisplayColor() accesses that key directly.

A local null-check workaround stops the warning, but this should be handled upstream.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in apps/dav/lib/CalDAV/Federation/FederatedCalendarImpl.php, focusing on FederatedCalendarImpl::getDisplayColor() and its direct access to the calendar-color key. Verify the missing property case first, then confirm the completed change handles it without a PHP warning while preserving a null or fallback color.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.