Open DavaGordon opened 3 years ago
Hi @DavaGordon. Thank you for your report. To help us process this issue please make sure that you provided the following information:
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
@magento give me 2.4-develop instance
- upcoming 2.4.x release
For more details, please, review the Magento Contributor Assistant documentation.
Please, add a comment to assign the issue: @magento I am working on this
Join Magento Community Engineering Slack and ask your questions in #github channel.
:warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
:clock10: You can find the schedule on the Magento Community Calendar page.
:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.
:movie_camera: You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel
:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel
Hi @DavaGordon, I couldn't reproduce this issue on 2.4, can you confirm the steps and how to reproduce such problem?
Thanks.
Magneto 2 EE (2.3.6) / B2B Module / Magneto Cloud
Steps Admin Login > Customers
Filter by company name issue occurred reason for this is the reference of company name was coming from the company table which was not in the main table so when we filtered by company we received this issue. this was tested across 3 seperate websites all using similar environment specs and with all none standard magento modules disabled.
Outcome Unable to filter by company name. after some investigation i found that the original code
if (is_string($field) && count(explode('.', $field)) === 1) {
Always returned true as a result the it returning true the prefix of main_table was added to company_name which if you look at the overall code did no exist in the customer_grid_flat table as we had the company module active so the code should have returned false and retrieved the value from the
company.company_name rather than customer_grid_flat(main_table).company_name
The code below which was put in place on all 3 environments checks the main_table index to check if the column is valid if returns true it will append the main_table prefix otherwise the reference will look in the correct place which is the company table
if (is_string($field) && in_array($field, $this->getFulltextIndexColumns())) {
Tested 3 environments no link in code base 3 seperate companies all same issue. fix resolves issue for all 3
This bug occurs in Magento 2.3.7-pt2 as well. Default Magento does not have Company fields setup but once customers are linked to companies, I believe it's not hard to reproduce this error.
Solved this on our platform with a before plugin.
/**
* Fix Magento 2.3.7 problem of not being able to locate the company_name field.
*
* @param \Magento\Customer\Model\ResourceModel\Grid\Collection $subject
* @param $field
* @param $condition
* @return array
*/
public function beforeAddFieldToFilter(\Magento\Customer\Model\ResourceModel\Grid\Collection $subject, $field, $condition) {
if (strpos($field, 'company_name') !== false ) {
$field = 'company.company_name';
}
return [$field, $condition];
}
It's not really necessary to reproduce this ticket in order to see that this problem exists.
The list of columns in customer_grid_flat
is : ["name","email","created_in","taxvat","shipping_full","billing_full","billing_firstname","billing_lastname","billing_telephone","billing_postcode","billing_region","billing_city","billing_fax","billing_company"]
By default, company_name (as in the search fields) is not in customer_grid_flat
. Thus, filtering by "company" breaks as it's not a part of the customer index. This should probably be fixed by someone on the team.
@danieluniform did u try reindexing? being a flat table it should add the missing column as it happened for me
Hi @engcom-November. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
[ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).Details
If the issue has a valid description, the label Issue: Format is valid
will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid
appears.
[ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description
label to the issue by yourself.
[ ] 3. Add Component: XXXXX
label(s) to the ticket, indicating the components it may be related to.
[ ] 4. Verify that the issue is reproducible on 2.4-develop
branchDetails
- Add the comment @magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
[ ] 5. Add label Issue: Confirmed
once verification is complete.
[ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
Verified the issue on Magento 2.4-develop all instances : Enterprise and B2B but observed different behavior while verifying the issue but no exception/errors observed in logs. Scenario 1: 2.4-develop branch without B2B: Customers - All Customers - Filtering with Company column (updated with billing / Shipping Addresses - Company name) working fine. Address company name displayed in the grid - No issue Scenario 2: B2B instance: After installing B2B modules - Company name got removed for all the existing customers from the All customers page. Created a Company account from front end - and verified Admin - Customers - All Customers page - Company name is updated in Company column. however filtering with Company name is not working. Filtering with Address - Company name is working
:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-6683 is successfully created for this GitHub issue.
:white_check_mark: Confirmed by @engcom-November. Thank you for verifying the issue.
Issue Available: @engcom-November, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
Hello,
Internal team has started to work on it
Thanks.
Preconditions (*)
Steps to reproduce (*)
After further investigation and collaboration i have found the cause for the issue, to replicate this issue.
A new collection is needed with an add a join from a field from the custom table to the customer grid collection, and try to filter the collection with that field.
Expected result (*)
Actual result (*)
After installing B2B, Company name is removed for all existing normal customers from Customers page. For Company Account customers - Company name is displayed in the Company column but filtering with the same company name is not working. Filtering with billing / shipping Address - Company name works.
Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.