Skip to content

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
Contributor

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

4 participants