-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Fixes #18357 - SQL error when table prefix used. #18412
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
Fixes #18357 - SQL error when table prefix used. #18412
Conversation
Hi @pocallaghan Thank you |
@@ -64,7 +64,7 @@ private function getStoresForAgreements() | |||
|
|||
if (!empty($agreementId)) { | |||
$select = $this->getConnection()->select()->from( | |||
['agreement_store' => 'checkout_agreement_store'] | |||
['agreement_store' => $this->getResource()->getTable('checkout_agreement_store')] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you for your fix. The solution looks reasonable. The reason why this issue appeared is that there is not an integration test for this case. We are running integration tests with and w/o table prefixes to make sure that such issues won't appear.
Please cover this case with the integration test (and earn additional contribution points :) ) to avoid a regression issue for your solution.
Also, could you please fix broken static tests.
Thank you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@okobchenko is getResource()
really neccessary?
Hi @pocallaghan. Thank you for your contribution. |
Description
Hard-coded table names cause errors if a table prefix, passing the table name to getTable resolves this.
Fixed Issues (if relevant)
Manual testing scenarios
Contribution checklist