Skip to content

Forms: a required file property can never be satisfied by an upload token #4646

Open

Description

@WilcoLouwerse

Found during a Strict review of #4580 (development → beta promotion). Present on development; introduced in #4563.

Impact

Every stored form whose destination schema marks a file property required refuses every submission with 422, so residents cannot submit it at all. Fires on the happy path, no precondition beyond the schema shape.

The chain

mapPayload() moves an upload token's file into $plan['files'] and leaves the property out of $plan['object']. validateAll() then validates $plan['object'] only; the excusals are default, computed and serverSet properties (and required in draft mode). A destination schema with a required file property therefore reports required for that property on every submit, even when the submitter attached a valid file, and the form can never be sent. The one upload test uses bijlage, which is not in the schema's required list, so nothing covers this. I could not run PHPUnit here (no vendor directory in the worktree), so this is read from the code; uncertain, hence blocker under Strict.

lib/Service/Form/FormSubmitService.php:644 — verified against b9e5d8df40.

Reproduction

Verified by reading the code at b9e5d8df40; not executed (no vendor tree, no rig in the review).
Verification: grep -n "required: \['title', 'caseType', 'identifier'\]" tests/Unit/Service/Form/FormSubmitServiceTest.php → the test schema's required list excludes the file property bijlage

Suggested direction

Treat a property that has an upload in $plan['files'] as supplied when validating: add it to notSupplied/excusals as uploaded, or validate against an object where the property holds a placeholder. Unit seam: FormSubmitServiceTest with a schema whose required list contains the file property.

Done when: a submit with a required file property and a valid upload token is accepted (201); a submit with a required file property and no token still answers 422 required

Review thread

#4580 (comment)

Fix

Proposed in #4655 (not merged yet).

Activity

  1. github-actions commented on Oct 15, 2026

    @github-actions
    Contributor

    Thank you for opening this issue! It has been assigned to @rubenvdlinde for review.

    What happens next:

    1. A maintainer will review this issue and determine the appropriate action
    2. If accepted, it may be converted into an OpenSpec change for structured development
    3. You will be notified of any status changes

    Triage labels:

    • triage:accept-feature — accepted as a new feature
    • triage:accept-bugfix — accepted as a bug fix
    • triage:needs-info — more information needed
    • triage:wontfix — will not be addressed
    • triage:duplicate — duplicate of another issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingtriageAwaiting triage

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions