-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Remove wrong '_setup' replace when getting DB connection (2) #9726
Remove wrong '_setup' replace when getting DB connection (2) #9726
Conversation
… database resource contains '_setup', default is returned as resourceName does not match after replacement
To me this looks like it would rely on the functionality that is removed. As to why this is implemented in such a way I don't know. |
Hi @fooman , Actually the code that you mention has nothing to do with that. This 2 lines of code are simply creating a new instance of I have checked all calls to the method edited in this pull request and the only For me there is no such need to replace |
Thanks @jalogut for the explanation. I'll progress this PR along (this will run tests on the EE version as well) and will try to get someone from the Magento side to let us know why this was done in the first place. |
@jalogut apologies for the delay. The internal testsuite looks all good for your proposed changes. Would you mind quickly addressing this mini style issue highlighted by codacy here https://www.codacy.com/app/antonkril/magento2/pullRequest?prid=592044 |
Hi @fooman, Done. |
@jalogut good stuff - will keep you posted. |
Thank you @jalogut for your contribution - it's been merged. |
Description
I a second custom database into
etc/env.php
is added like that, it is not possible to get the database connection usingcustom_setup
as$resourceName
:After that I would expect to use the custom database by resource name
custom_setup
. However, as_setup
is always replaced, the system does not find any resource with this name. Then, I need to use a different name without_setup
. From my point of view, there is no need to replace that. In fact, the only reason whydefault_setup
database works is becausedefault
connection is the fall back. When calling resourcedefault_setup
is also not found but it falls back todefault
.What is exactly the purpose of replacing
_setup
? I checked the code and I do not see any need to have that.Fixed Issue
If a custom database resource contains '_setup', default is returned because
$resourceName
does not match after replacement