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

Fix <ReferenceArrayField /> throw error when its value is not an array #7899

Merged
merged 7 commits into from
Jul 6, 2022

Conversation

shreyas-jadhav
Copy link
Contributor

if record.source is not an array it throws ids.map is not a function error. i think it should be same behavior as "no records matched" and use show empty array in this case.

it is possible same apps have different data type of a field and not always an array.
but it shouldn't crash entire list component because of that

@vercel vercel bot temporarily deployed to Preview – react-admin June 26, 2022 15:33 Inactive
@djhi djhi changed the title do array check in <ReferenceArrayField /> Fix <ReferenceArrayField /> throw error when its value is not an array Jun 28, 2022
@vercel vercel bot temporarily deployed to Preview – react-admin July 6, 2022 12:39 Inactive
…ntroller.ts

Co-authored-by: Gildas Garcia <1122076+djhi@users.noreply.github.com>
@vercel vercel bot temporarily deployed to Preview – react-admin July 6, 2022 12:43 Inactive
@djhi
Copy link
Contributor

djhi commented Jul 6, 2022

Thanks!

@shreyas-jadhav
Copy link
Contributor Author

Sorry! should pass now

@djhi djhi merged commit b17116b into marmelab:master Jul 6, 2022
@djhi djhi added this to the 4.2.1 milestone Jul 6, 2022
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 this pull request may close these issues.

None yet

3 participants