-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
SQL Syntax Error with CanBeOneOfMany if primaryKey of related model is null #46463
Comments
Hey there, Unfortunately we don't support this version anymore. Please check out our support policy on which versions we are currently supporting. Can you please try to upgrade to the latest version and see if your problem persists? If so, please open up a new issue and we'll help you out. Thanks! |
Please also don't open Lumen issues on the framework repo. |
@driesvints I mentioned in first paragraph "Problems exists in core Laravel till today as I see in repo." So with almost 100% sure it exists in 10.x also. |
@driesvints are you going to recheck it for 10.x ? |
Description:
SQL parsers adds empty column to query. Problems exists in core Laravel till today as I see in repo.
Steps To Reproduce:
Add relation to your model
Relation have to be with nulled primaryKey
Problems starts when
$keyName
became null in here https://github.com/laravel/framework/blob/10.x/src/Illuminate/Database/Eloquent/Relations/Concerns/CanBeOneOfMany.php#L77Possible solution is to ignore null here https://github.com/laravel/framework/blob/10.x/src/Illuminate/Database/Eloquent/Relations/Concerns/CanBeOneOfMany.php#L93
The text was updated successfully, but these errors were encountered: