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

ArrayInput with array of strings throws "Cannot set a numeric property on an object" #4823

Closed
NikitaVlaznev opened this issue May 17, 2020 · 3 comments · Fixed by #4819
Closed

Comments

@NikitaVlaznev
Copy link
Contributor

NikitaVlaznev commented May 17, 2020

I have started to get a

Cannot set a numeric property on an object

exception on my forms with ArrayInputs for fields that contains an array of strings.

Bug have appeared in version 3.5.2 after PR #4810.

This happens because this is not a correct way to detect an object values that are used as a subdictionary:

if (value && Object.keys(value).length > 0)

It failes on strings and may be with something else, because:

Object.keys("cats")
[ '0', '1', '2', '3' ]
@alanpoulain
Copy link
Contributor

PR to fix this issue: #4819.

@fzaninotto
Copy link
Member

Fixed by #4819

@amilosmanli
Copy link
Contributor

Getting the same issue with <ReferenceArrayInput> and <AutocompleArrayInput>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants