Skip to content
This repository has been archived by the owner on Feb 28, 2023. It is now read-only.

Model cleanup on schema change does not work with nested schema #227

Closed
victorlambert opened this issue Sep 7, 2021 · 2 comments · Fixed by #228
Closed

Model cleanup on schema change does not work with nested schema #227

victorlambert opened this issue Sep 7, 2021 · 2 comments · Fixed by #228
Assignees

Comments

@victorlambert
Copy link
Contributor

victorlambert commented Sep 7, 2021

Describe the bug
When nested schema with conditions are used, model cleanup on schema change throw this error :
Cannot read property 'split' of undefined
To Reproduce

  1. Create a nested schema with preventModelCleanupOnSchemaChange on true
  2. Use condition property to conditionally display a field
  3. Fulfil condition, the field display correctly
  4. Unfulfil condition, formvuelate try to cleanup model and throw an error

Expected behavior
The field should disappear with model cleanup

System Info

  • FormVueLate version: 3.5.0
  • plugins being used with versions:
    @formvuelate/plugin-vee-validate: 3.4.0
    vee-validate : 4.4.9

Additional context
findNestedFormModelProp expect formModel on first param

export const findNestedFormModelProp = (formModel, path) => {

And we do not provide it in findNestedFormModelProp

delete findNestedFormModelProp(path)[prop]

@logaretm
Copy link
Collaborator

logaretm commented Sep 7, 2021

Which version of vee-validate (not the plugin) are you using?

@logaretm logaretm self-assigned this Sep 7, 2021
@victorlambert
Copy link
Contributor Author

I'm using 4.4.9.

victorlambert added a commit to victorlambert/formvuelate that referenced this issue Sep 7, 2021
marina-mosti pushed a commit that referenced this issue Sep 8, 2021
* fix: model cleanup not working with nested schemas (fix #227)

* test: add model cleanup with nested schemas unit test
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants