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

[L5.5] HasManyThrough signature incompatible with Laravel's HasManyThrough #3083

Closed
mmvcode opened this issue Sep 5, 2017 · 3 comments
Closed

Comments

@mmvcode
Copy link

mmvcode commented Sep 5, 2017

Expected behavior

In a hasManyThrough relation using October's HasManyThrough, the constructor calls the parent with 6 arguments. However, the parent class, Illuminate\Database\Eloquent\Relations\HasManyThrough
requires 7.

Actual behavior
Type error: 
Too few arguments to function Illuminate\Database\Eloquent\Relations\HasManyThrough::__construct(), 6 passed in
 vendor\october\rain\src\Database\Relations\HasManyThrough.php on line 24 and exactly 7 expected
vendor\laravel\framework\src\Illuminate\Database\Eloquent\Relations\HasManyThrough.php line 67
Reproduce steps

Add a hasManyThrough relation to a model.

October build

421

@daftspunk daftspunk changed the title HasManyThrough signature incompatible with Laravel's HasManyThrough [L5.5] HasManyThrough signature incompatible with Laravel's HasManyThrough Sep 5, 2017
@KonstantinObuhov
Copy link
Contributor

KonstantinObuhov commented Sep 5, 2017

I have the same problem.
I add relation like this.

cities
id - integer
name - string

serts
id - integer
city_id - integer
name - string

sert_orders
id - integer
sert_id - integer

@mmvcode
Copy link
Author

mmvcode commented Sep 5, 2017

Just as a note, this only happens when using the $hasManyThrough = []; property, it works fine when defining relations through methods.

daftspunk added a commit to octobercms/library that referenced this issue Sep 5, 2017
Looks like they've recently added a secondLocalKey (named secondOtherKey in October)
Fixes octobercms/october#3083
@daftspunk
Copy link
Member

Should be fixed in Build 422+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants