Skip to content

[Bug]: cs translation placeholders in dav break CalDAV PUT for all-day events (ValueError vsprintf) #58409

@MiPal75

Description

@MiPal75

⚠️ This issue respects the following points: ⚠️

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

  1. Set user language to Czech (cs).
  2. Create an event as all-day (entire day, no times).
  3. Make sure scheduling/invitation logic is triggered (e.g. shared calendar / attendees / invitation email enabled).
  4. 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

  1. Set a user language to Czech (cs) in Nextcloud.
  2. Create a new calendar event that is all-day (no start/end time).
  3. Share the event / have attendees so scheduling/iMIP code runs (invitations enabled).
  4. 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",

Metadata

Metadata

Assignees

No one assigned

    Labels

    0. Needs triagePending check for reproducibility or if it fits our roadmap32-feedbackbug

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions