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

OrderByJoin for BelongsTo relationships breaks in laravel 5.5 #112

Open
ADRDev opened this issue Nov 11, 2020 · 1 comment
Open

OrderByJoin for BelongsTo relationships breaks in laravel 5.5 #112

ADRDev opened this issue Nov 11, 2020 · 1 comment

Comments

@ADRDev
Copy link

ADRDev commented Nov 11, 2020

#104

This PR changed how the correct method call is determined by checking if the method name is_callable() or not. However, in our testing with a BelongsTo relationship in Laravel 5.5 is_callable() is returning true no matter what method name you pass and so picks the wrong method to call resulting in an error.

We have rolled back to 4.1.1 in the meantime where the old version check logic is in place.

@NesCafe62
Copy link

NesCafe62 commented Nov 20, 2020

I encountered same problem with Eloquent 5.7.17 when updated my fork.
Update: I changed is_callable([$relatedRelation, 'getQualifiedForeignKeyName']) to method_exists($relatedRelation, 'getQualifiedForeignKeyName') (same with 'getOwnerKeyName') and it seems to start working

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

No branches or pull requests

2 participants