-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[Bug fix] Fix BelongToMany when using ObjectId in relation #3014
base: 5.x
Are you sure you want to change the base?
[Bug fix] Fix BelongToMany when using ObjectId in relation #3014
Conversation
Can you please add tests for this change? Thank you! |
Yes of course when I have a little time. |
Add Test OK. |
Sorry for the time it takes to review your PR. This part of the code is complicated and we need to ensure this is feature we can support and maintain for the long run. The more we copy and modify code from the parent class, the more difficult it is to maintain and keep compatibility with multiple versions of Laravel version (even minor version can break). Also, I guess |
No problem, the big change is in the "formatRecordsList" method, which currently assumes the existence of a pivot table. |
Changes in version 4.6 make this modification incompatible. should I make the changes? |
When we use mongodb ObjectIDs for relationships
In the case of a BelongToMany relation, the foreignKeys was incorrectly cast
With the type check, the cast is adapted to avoid converting an object into an associative array.
#3015
Checklist