Skip to content

Admin: clearing an optional datetime field saves "", which fails validation ("Invalid input") #4424

Open

Description

@NegativeAL

EmDash 1.3.1.

Steps: In the content editor, type a value into an optional datetime field, clear it, then save.

Result: The request sends "field": "". The server validator (zod-generator.ts: z.iso.datetime(...) with .nullish()) rejects it with a VALIDATION_ERROR invalid_union, so the entry can't be saved until the field holds a date again.

Cause: fromDatetimeLocalInputValue in the admin returns "" for an empty input.

Suggested fix: return null when the field isn't required, or have the server treat "" as null for optional datetime fields.

Activity

  1. added
    bot:fixAssign this issue or pull request to the EmDash bot to fix
    on Oct 26, 2026
  2. emdash-autofix commented on Oct 26, 2026

    @emdash-autofix
    Contributor

    The EmDash bot's work on this issue continues in #4425.

  3. emdash-autofix commented on Oct 26, 2026

    @emdash-autofix
    Contributor

    The fix is ready in PR #4425, and the required checks have passed. Clearing an optional datetime now saves null, including in repeater sub-fields. Could you confirm that this resolves your original steps when you try the fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/adminbot:fixAssign this issue or pull request to the EmDash bot to fixtriage/awaiting-reporterFix pushed, waiting on reporter to verify

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions