Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hidden required choicefields that do not have a value, don't validate #4096

Closed
joeribekker opened this issue Apr 3, 2024 · 6 comments · Fixed by #4116
Closed

Hidden required choicefields that do not have a value, don't validate #4096

joeribekker opened this issue Apr 3, 2024 · 6 comments · Fixed by #4116
Assignees
Labels
bug Something isn't working needs-backport Fix must be backported to stable release branch owner: utrecht topic: validation
Milestone

Comments

@joeribekker
Copy link
Contributor

joeribekker commented Apr 3, 2024

Ref: Taiga Utrecht 195

rest_framework.exceptions.ValidationError: {'steps': [{}, {'data': {'bentUEenPersoonOfEenBedrijf': [ErrorDetail(string='"" is een ongeldige keuze.', code='invalid_choice')]}}, {}]}

In dit formulier wordt deze vraag verborgen d.m.v. de logica. Als dit veld wél wordt getoond is het een verplichte vraag. Kan het zijn dat doordat de verborgen velden sinds 2.6.1 worden meegestuurd de backend deze waardes ook valideert en daarover struikelt?

@joeribekker joeribekker added the bug Something isn't working label Apr 3, 2024
@joeribekker joeribekker added this to the Release 2.6.2 milestone Apr 3, 2024
@sergei-maertens sergei-maertens added the needs-backport Fix must be backported to stable release branch label Apr 3, 2024
@joeribekker
Copy link
Contributor Author

Reproduced on our test environment:

{
    "type": "https://open-forms.test.maykin.opengem.nl/fouten/ValidationError/",
    "code": "invalid",
    "title": "Invalid input.",
    "status": 400,
    "detail": "",
    "instance": "urn:uuid:5e3d3e11-246d-40d6-913f-f9e11d02b578",
    "invalidParams": [
        {
            "name": "steps.1.data.bentUEenPersoonOfEenBedrijf",
            "code": "invalid_choice",
            "reason": "\"\" is een ongeldige keuze."
        }
    ]
}

caused by this required field:

image

@Viicos
Copy link
Contributor

Viicos commented Apr 3, 2024

@joeribekker Which form ID on our test env?

@sergei-maertens
Copy link
Member

Probably we'll need more cases here:

and of course a regression test

@Viicos
Copy link
Contributor

Viicos commented Apr 3, 2024

I'm not able to reproduce, waiting for the form ID to actually debug

@sergei-maertens
Copy link
Member

This may have the same cause as DH#671 and be fixed by #4114

@Viicos
Copy link
Contributor

Viicos commented Apr 3, 2024

This is only reproducible if clear on hide is not set

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-backport Fix must be backported to stable release branch owner: utrecht topic: validation
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants