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

Allow hidden fields to be sent to registration systems #3890

Closed
joeribekker opened this issue Feb 15, 2024 · 3 comments · Fixed by #3934 or #4123
Closed

Allow hidden fields to be sent to registration systems #3890

joeribekker opened this issue Feb 15, 2024 · 3 comments · Fixed by #3934 or #4123

Comments

@joeribekker
Copy link
Contributor

Thema / Theme

Admin

Omschrijving / Description

Hidden fields are currently not sent to the registration backend. Can we make this happen, optionally?

Request comes from Utrecht who wants this, using the Objects API where it's added to {{ data }} so it automatically ends up in the registration system. It was not enough that they could manually add it elsewhere in the JSON field.

Added value / Toegevoegde waarde

No response

Aanvullende opmerkingen / Additional context

No response

@joeribekker joeribekker added triage Issue needs to be validated. Remove this label if the issue considered valid. enhancement owner: utrecht labels Feb 15, 2024
@joeribekker joeribekker added this to the Release 2.6.0 milestone Feb 15, 2024
@joeribekker
Copy link
Contributor Author

I left triage label but also added it to the sprint because Utrecht needs this but I can also see it conflicting with #3688

@sergei-maertens
Copy link
Member

https://github.com/open-formulieren/open-forms/blame/master/src/openforms/formio/rendering/structured.py - this seems to skip the hidden fields/nodes which is unfortunate if you're trying to register submission data to the objects API :)

@sergei-maertens
Copy link
Member

Refinement: the new registration mechanism in the objects API will not be able to handle additionalProperties: true in 2.6.0, so the problems of Utrecht are not solved in time yet. Meaning we need to implement this.

The fix should be rather straight forward.

@sergei-maertens sergei-maertens removed the triage Issue needs to be validated. Remove this label if the issue considered valid. label Feb 19, 2024
@vaszig vaszig assigned vaszig and unassigned SilviaAmAm Feb 22, 2024
vaszig added a commit that referenced this issue Feb 27, 2024
sergei-maertens added a commit that referenced this issue Feb 28, 2024
…den-fields-to-be-sent-to-registration-systems

[#3890] Allow hidden fields to be sent to registration systems
sergei-maertens added a commit that referenced this issue Apr 5, 2024
While the original bug report expects/states that the hidden fields should
not be included at all in the objects API data, this is not actually a
bug but a deliberate action - it was patched in #3890. It was never
intentional to *not* send (the values) of hidden fields.

This does however mean that the defined object type JSON schema's
need to be updated to account for possible empty values, where
the data type of empty is determined by the component type of
the field (e.g. number and currency are 'null', but textfield is
always going to be string).

What *was* broken however, is that missing values were always
sent as `null\' rather than the empty value that's component
specific.

There is an additional report of an entire fieldset being
hidden resulting in the values not being sent, so that will
require patching too.
sergei-maertens added a commit that referenced this issue Apr 5, 2024
While the original bug report expects/states that the hidden fields should
not be included at all in the objects API data, this is not actually a
bug but a deliberate action - it was patched in #3890. It was never
intentional to *not* send (the values) of hidden fields.

This does however mean that the defined object type JSON schema's
need to be updated to account for possible empty values, where
the data type of empty is determined by the component type of
the field (e.g. number and currency are 'null', but textfield is
always going to be string).

What *was* broken however, is that missing values were always
sent as `null\' rather than the empty value that's component
specific.

There is an additional report of an entire fieldset being
hidden resulting in the values not being sent, so that will
require patching too.
sergei-maertens added a commit that referenced this issue Apr 5, 2024
While the original bug report expects/states that the hidden fields should
not be included at all in the objects API data, this is not actually a
bug but a deliberate action - it was patched in #3890. It was never
intentional to *not* send (the values) of hidden fields.

This does however mean that the defined object type JSON schema's
need to be updated to account for possible empty values, where
the data type of empty is determined by the component type of
the field (e.g. number and currency are 'null', but textfield is
always going to be string).

What *was* broken however, is that missing values were always
sent as `null\' rather than the empty value that's component
specific.

There is an additional report of an entire fieldset being
hidden resulting in the values not being sent, so that will
require patching too.
sergei-maertens added a commit that referenced this issue Apr 5, 2024
While the original bug report expects/states that the hidden fields should
not be included at all in the objects API data, this is not actually a
bug but a deliberate action - it was patched in #3890. It was never
intentional to *not* send (the values) of hidden fields.

This does however mean that the defined object type JSON schema's
need to be updated to account for possible empty values, where
the data type of empty is determined by the component type of
the field (e.g. number and currency are 'null', but textfield is
always going to be string).

What *was* broken however, is that missing values were always
sent as `null\' rather than the empty value that's component
specific.

There is an additional report of an entire fieldset being
hidden resulting in the values not being sent, so that will
require patching too.

Backport-of: #4123
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment