[Bug]: Federated calendar without calendar-color property triggers PHP warning in FederatedCalendarImpl
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
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.
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
- Set up two federated Nextcloud instances.
- Share a calendar from instance A to a user on instance B.
- Open the dashboard or another view on instance B that loads the federated calendar metadata.
- Check
nextcloud.logon 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.
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d
- Merged PRs (30d)
- 725
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nextcloud/server
-
3. to review
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
0. Needs triage 33-feedback bug feature: dashboard feature: files feature: theming needs info
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
0. Needs triage bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
.htaccess whitelist missing .json/.ftl → files_pdfviewer locale 404s, PDF viewer stuck in English Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
0. Needs triage 34-feedback bug
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
All issues in nextcloud/server
Similar issues
-
priority: p3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
googleapis/librarian#7636 ·
-
0. Needs triage bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nextcloud/fulltextsearch#1011 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
phpstan/phpstan-doctrine#794 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Automattic/static-site-importer#1767 ·