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

[8.x] fix updated with provided qualified updated_at #41133

Merged
merged 1 commit into from
Feb 21, 2022
Merged

[8.x] fix updated with provided qualified updated_at #41133

merged 1 commit into from
Feb 21, 2022

Conversation

rodrigopedra
Copy link
Contributor

@rodrigopedra rodrigopedra commented Feb 21, 2022

Fixes #41128

This work as expected:

User::query()->update(['updated_at' => null]);

While this does not:

User::query()->update(['users.updated_at' => null]);

This PR:

  • Fixes the Eloquent\Builder@addUpdatedAtColumn to verify for a qualified updated account
  • Adds two relevant tests that would not pass without the changes proposed in this PR

Notes:

  • As this is a bug fix I targeted branch 8.x
  • The reason I used Arr::get(...) instead of the null coalescing operator is to allow users to specify a null value as they can when not qualifying the updated_at column

@rodrigopedra rodrigopedra changed the title [8.x] fix updated with provided qualified updated_at - closes #41128 [8.x] fix updated with provided qualified updated_at Feb 21, 2022
@taylorotwell taylorotwell merged commit 424bdd4 into laravel:8.x Feb 21, 2022
@rodrigopedra rodrigopedra deleted the check-qualified-updated-at branch February 21, 2022 18:06
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

Successfully merging this pull request may close these issues.

2 participants