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: component dehydration #83

Merged

Conversation

saade
Copy link
Contributor

@saade saade commented Feb 15, 2024

When using relationships, fields must not be dehydrated, otherwise, (when strict) a MassAssignmentException is thrown.

As far i can see, this plugin only supports relationships, right? If yes, its fine as is. If not (supports arrays too) we need to add this fix only inside relationship() method.

Thanks!

@CodeWithDennis
Copy link
Owner

The plugin only supports BelongsTo and HasMany at the moment.

@CodeWithDennis CodeWithDennis merged commit 3c5de49 into CodeWithDennis:3.x Feb 15, 2024
1 check passed
@CodeWithDennis
Copy link
Owner

Thanks @saade !

@saade saade deleted the fix/relationship-dehydration branch February 15, 2024 14:54
@ariaieboy
Copy link
Contributor

@CodeWithDennis this PR is broking my applications.
It sets the relation to null
when I set ->dehydrated(true) on the field it works just fine

@saade
Copy link
Contributor Author

saade commented Feb 17, 2024

I see why, the component is not handling the BelongsTo relationship inside saveRelationshipsUsing i thought it was. Gonna submit a fix asap.

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.

3 participants