-
Notifications
You must be signed in to change notification settings - Fork 33
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nested relationship search is broken in 2.0.0 #31
Comments
Confirmed, the "ensureRelationshipExists" method in "RelationSearch" does not take into account nested relations |
Tried a "quick fix", if you replace the current content (I run php8 so some changes might be required) with the following: if (!str_contains($relation, '.')) {
$query->getRelation($relation);
}
$parts = explode('.', $relation);
$rel = $query;
while(!empty($parts)) {
$rel = $rel->getRelation(array_shift($parts));
} Then it will be able to resolve the nested relations |
We just upgraded to v2.0 recently and got bit by this issue :( |
Thank you @TitasGailius! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice package! 馃槉
Trying out your package, I found that nested relationship search is broken in 2.0.0, as it returns
Call to undefined relationship [user.country]
now.Works in 1.0.6 though.
The text was updated successfully, but these errors were encountered: