Skip to content

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

Merged
taylorotwell merged 1 commit into
laravel:11.xfrom
SjorsO:fix-bc
Jan 6, 2025
Merged

[11.x] Fix breaking change in RefreshDatabase#54075
taylorotwell merged 1 commit into
laravel:11.xfrom
SjorsO:fix-bc

Conversation

@SjorsO

@SjorsO SjorsO commented Jan 4, 2025

Copy link
Copy Markdown
Contributor

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.

@mariomka

mariomka commented Jan 7, 2025

Copy link
Copy Markdown
Contributor

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
Copy Markdown

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