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

[11.x] Fix breaking change in RefreshDatabase #54075

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

SjorsO
Copy link
Contributor

@SjorsO SjorsO commented Jan 4, 2025

This PR fixes a breaking chance introduced by #53997, as reported by this comment.

I haven't been able to reproduce it, but sometimes $connection->getPdo() can be null.

Also, you've asked if it was possible to test the changes in the original PR. I've tried, but I haven't been able to come up with a meaningful way to unit test this.

@taylorotwell taylorotwell merged commit 56fa89d into laravel:11.x Jan 6, 2025
40 checks passed
@mariomka
Copy link

mariomka commented Jan 7, 2025

I get the same issue, and this PR fixes it. But why does it happen? It could be related to multiple connections. We use multiple, so we overwrite the method connectionsToTransact().

@citricguy
Copy link

In our tenancy project we override $connectionsToTransact and we include null in the array.

protected array $connectionsToTransact = [null, 'tenant'];

I suspect it's this null value causing some pain for people using it in this way. This was related to archtechx/tenancy specifically, but I suspect others have similar issues.

Can confirm this will fix it. Thank you all for taking care of this!

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.

4 participants