-
Notifications
You must be signed in to change notification settings - Fork 11.3k
Regression after PR #55471: Error when accessing nested attributes in manually set relations #55535
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
Comments
Everything related to these changes were reverted at: dc5b445 Please update to Laravel 12.10.2 |
I see the test is removed completely (dc5b445). Is it possible for you to add a regression test like this $model = new class extends Model {};
$model->setRelations(['many' => ['one', 'two', 'three' => 84]]);
$result = $model->getAttribute('many.three'); |
This would be a test to prevent future attempts on this, right? I know about some test cases added for that reason, like the one which prevents pagination after calling I am not a maintainer, so I am not sure if these kinds of test cases are wanted/accepted, other in those particular cases. You can give it a try, though. Anyway, thanks for the suggestion. |
12.10.2 |
Thanks @decadence ! I updated my comment. |
Laravel Version
12.10.1
PHP Version
8.4
Database Driver & Version
No response
Description
After merging #55471, a regression was introduced in how manually set relations are handled via
setRelations()
. Behavior that previously returnednull
now results in a fatal error.Attempts to address this in #55518 and #55519 do not fully restore the expected behavior.
Steps To Reproduce
✅ Expected behavior:
In versions prior to
12.10.1
, this would returnnull
.❌ Actual behavior:
As of
12.10.1
(and with the mentioned PRs applied), the following error is thrown:The text was updated successfully, but these errors were encountered: