magento2
magento2 copied to clipboard
fix Column 'customer_id' in where clause is ambiguous,
Description (*)
Add main_table to select for customer online filter.
Fixed Issues (if relevant)
When we try to filter the online customer grid we have an issue :
Integrity constraint violation: 1052 Column 'customer_id' in where clause is ambiguous, query was: SELECT `main_table`.*, `customer`.`email`, `customer`.`firstname`, `customer`.`lastname`, IF(main_table.customer_id IS NOT NULL AND main_table.customer_id != 0, 'c', 'v') AS `visitor_type`, `company_customer`.`company_id`, `company`.`company_name` FROM `customer_visitor` AS `main_table` LEFT JOIN `customer_entity` AS `customer` ON customer.entity_id = main_table.customer_id LEFT JOIN `company_advanced_customer_entity` AS `company_customer` ON main_table.customer_id = company_customer.customer_id LEFT JOIN `company` ON company.entity_id = company_customer.company_id WHERE (main_table.last_visit_at >= '2023-07-28 09:34:09') AND (((`customer_id` > 0))) ORDER BY customer_id ASC LIMIT 20 in /app/vendor/magento/framework/DB/Statement/Pdo/Mysql.php:109
Manual testing scenarios (*)
- In admin Navigate to customers -> Now Online
- Try to filter "type" -> value "customer"
- Enjoy
Contribution checklist (*)
- [ ] Pull request has a meaningful description of its purpose
- [ ] All commits are accompanied by meaningful commit messages
- [ ] All new or changed code is covered with unit/integration tests (if applicable)
- [ ] README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
- [ ] All automated tests passed successfully (all builds are green)
Resolved issues:
- [x] resolves magento/magento2#37822: fix Column 'customer_id' in where clause is ambiguous,
Hi @BeardTech. Thank you for your contribution! Here are some useful tips on how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:
@magento give me test instance- deploy test instance based on PR changes@magento give me 2.4-develop instance- deploy vanilla Magento instance
:exclamation: Automated tests can be triggered manually with an appropriate comment:
@magento run all tests- run or re-run all required tests against the PR changes@magento run <test-build(s)>- run or re-run specific test build(s) For example:@magento run Unit Tests
<test-build(s)> is a comma-separated list of build names.
Allowed build names are:
Database CompareFunctional Tests CEFunctional Tests EEFunctional Tests B2BIntegration TestsMagento Health IndexSample Data Tests CESample Data Tests EESample Data Tests B2BStatic TestsUnit TestsWebAPI TestsSemantic Version Checker
You can find more information about the builds here :information_source: Run only required test builds during development. Run all test builds before sending your pull request for review.
For more details, review the Code Contributions documentation. Join Magento Community Engineering Slack and ask your questions in #github channel.
@magento create issue
@magento run all tests
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.
@magento run all tests
Hello @BeardTech,
We have noticed that this PR has not been updated for a period of long time. Hence we are closing this PR for now.
Let us know when you are ready to work on it again, and we will be happy to re-open it. Thank you for your contribution!
Thanks