-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
⚠️ This issue respects the following points: ⚠️
- This is a bug, not a question or a configuration/webserver/proxy issue.
- This issue is not already reported on Github OR Nextcloud Community Forum (I've searched it).
- Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- I agree to follow Nextcloud's Code of Conduct.
Bug description
Bug description
When the user language is set to Czech (cs), creating/saving an all-day calendar event (no start/end time) can fail with a server-side exception during CalDAV PUT.
The server throws:
ValueError: The arguments array must contain 2 items, 1 given
coming from OC\L10N\L10NString.php (vsprintf), triggered from apps/dav/lib/CalDAV/Schedule/IMipService.php.
This effectively breaks event creation/sync for all-day events in Czech locale.
Steps to reproduce
- Set user language to Czech (
cs). - Create an event as all-day (entire day, no times).
- Make sure scheduling/invitation logic is triggered (e.g. shared calendar / attendees / invitation email enabled).
- Save the event.
(When both users are set to English, it works. When at least one user is Czech and the event is all-day, it fails.)
Expected behavior
Event should be saved successfully.
Actual behavior
CalDAV PUT fails and the event is not saved. Server logs show ValueError from vsprintf.
Server configuration
- Nextcloud: 32.0.6.1
- dav app: 1.34.2
- DB: PostgreSQL
- Request:
PUT /remote.php/dav/calendars/<user>/personal/<...>.ics
Relevant log / stack trace
(see below, shortened)
ValueError: The arguments array must contain 2 items, 1 given- Trace includes:
/var/www/nextcloud/lib/private/L10N/L10NString.php(vsprintf)/var/www/nextcloud/apps/dav/lib/CalDAV/Schedule/IMipService.php(generateWhenStringSingular)
Root cause
Czech translation contains wrong placeholders for the "for the entire day" plural strings.
The PHP code passes only one argument [$startDate] (plus %n), but some Czech translations incorrectly use %2$s.
This makes vsprintf require 2 arguments -> crash.
Problematic entries in apps/dav/l10n/cs.json include:
_In %n minute on %1$s for the entire day_::_In %n minutes on %1$s for the entire day_
(some forms use%2$s)_In %n month on %1$s for the entire day_::_In %n months on %1$s for the entire day_
(forms use%2$s)_In a minute on %1$s for the entire day_::_In %n minutes on %1$s for the entire day_
(first form uses%2$s)_In a month on %1$s for the entire day_::_In %n months on %1$s for the entire day_
(first form uses%2$s)
Workaround / local fix
Editing apps/dav/l10n/cs.json and replacing %2$s -> %1$s in the above translations fixes the issue immediately.
(But it will be overwritten by updates.)
Proposed fix
Fix Czech translations so that the "for the entire day" strings only use %1$s (and %n), never %2$s.
Also consider adding a sanity check/test for placeholder consistency to avoid runtime exceptions.
Steps to reproduce
- Set a user language to Czech (
cs) in Nextcloud. - Create a new calendar event that is all-day (no start/end time).
- Share the event / have attendees so scheduling/iMIP code runs (invitations enabled).
- Save the event (CalDAV PUT is triggered).
Expected behavior
Saving an all-day event should succeed and the CalDAV PUT request should not fail, regardless of the user language.
Nextcloud Server version
32
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.4
Web server
Apache (supported)
Database engine version
PostgreSQL
Is this bug present after an update or on a fresh install?
None
Are you using the Nextcloud Server Encryption module?
None
What user-backends are you using?
- Default user-backend (database)
- LDAP/ Active Directory
- SSO - SAML
- Other
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
Additional info
--- a/apps/dav/l10n/cs.json
+++ b/apps/dav/l10n/cs.json
@@
- "Za %n minutu v %2$s po celý den",
- "Za %n minutu v %1$s po celý den",
@@
- "Za %n měsíc v %2$s po celý den",
- "Za %n měsíc v %1$s po celý den",
@@
- "Za minutu %2$s po celý den",
- "Za minutu %1$s po celý den",
@@
- "Za měsíc %2$s po celý den",
- "Za měsíc %1$s po celý den",