open-formulieren / open-forms

Smart and dynamic forms
https://open-forms.readthedocs.io
Other
37 stars 26 forks source link

Bug/4727 crashing form after changing user variable to array #4797

Closed robinmolen closed 1 week ago

robinmolen commented 3 weeks ago

Closes #4727

Changes

Fixes the crashes on user variable dataType change, when a initialValue is defined. This crash happend when changing any dataType to the array dataType, because the component for the array dataType used the .some js array function. (It expected that the value was an array, so this function was used without any checks)

To resolve this situation, and possible similar situations in the future, the initialValue now gets transformed when the dataType changes. This transformation could result into losing the previous initialValue. To make sure that the dataType change is intentional, a confirmation message will be shown.

Checklist

Check off the items that are completed or not relevant.

codecov[bot] commented 3 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 96.55%. Comparing base (7a6e0d3) to head (1352126). Report is 6 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #4797 +/- ## ======================================= Coverage 96.55% 96.55% ======================================= Files 748 748 Lines 25413 25413 Branches 3358 3358 ======================================= Hits 24538 24538 Misses 610 610 Partials 265 265 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

sergei-maertens commented 1 week ago

Backports: