magento2: Country values missing in admin customer grid for multi-store configuration
Country values missing in “All Customers” admin grid, if multi-store with Account Sharing Options = per Website

Preconditions
- Any Magento version between 2.1.10 to 2.2.3
Steps to reproduce
- Vide demo: customer_grid_country_bug.mov
- Create 2 Websites
System > Config > General > Country Options > Allow Countries- Set different allowed countries for each website
System > Config > Customer Configuration > Share Customer Accounts > Per Website- Create a couple of user for each websites. Create also an address for each customer. S
et this address as default billing
5. execute bin/magento indexer:reindex customer_grid && bin/magento c:f
6. Check customer grid: Customer > All Customers
Expected result
- All customers have values on the country column
Actual result
- Only some customers have values in country column
Source of the bug
See my next comment where I explain the 2 reason why this bug is happening
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 3
- Comments: 15 (9 by maintainers)
Workaround
As workaround, we are using a plugin on the admin grid
etc/adminhtml/di.xml\Staempfli\CoreFixes\Plugin\Magento\Customer\Ui\Component\Listing\AttributeRepositoryPlugin