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 useReferenceManyFieldController fails with error when the record is not yet present #9236

Merged
merged 3 commits into from
Sep 1, 2023

Conversation

djhi
Copy link
Collaborator

@djhi djhi commented Aug 31, 2023

Problem:

<ReferenceManyField> throws the error: target and id are required when it’s used in an aside of an <Edit> component.

Checking if record does not exist with useRecordContext solves the problem.

Solution

useReferenceManyFieldController should check if the record exist before calling useGetManyReference

@djhi djhi added the RFR Ready For Review label Aug 31, 2023
Copy link
Contributor

@slax57 slax57 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to describe the case where you ran into this issue, and/or paste the error you got? This would make it easier for people having this same error to find this issue.

@slax57 slax57 added this to the 4.13.3 milestone Sep 1, 2023
@slax57 slax57 merged commit 52ba837 into master Sep 1, 2023
8 checks passed
@slax57 slax57 deleted the fix-use-reference-many-field-controller-record-null branch September 1, 2023 13:05
@slax57 slax57 changed the title Fix useReferenceManyFieldController fails with error when the record is not yet present Fix useReferenceManyFieldController fails with error when the record is not yet present Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants