fix: customer.language maps to shopId, not localeId - adding correct association#13
Open
PantherX99 wants to merge 3 commits into
Open
fix: customer.language maps to shopId, not localeId - adding correct association#13PantherX99 wants to merge 3 commits into
PantherX99 wants to merge 3 commits into
Conversation
Added additional joins for customer language and shop ID mapping.
Added left joins to fetch customer locale IDs along with language. customer.language maps to shopID and not directly to localeID
Nikolas Evers (vintagesucks)
approved these changes
Jun 17, 2026
Nikolas Evers (vintagesucks)
left a comment
Member
There was a problem hiding this comment.
Small suggestion for the PR title:
fix: resolve customer language through shop locale
This would be a bit shorter and describes the fix rather than the issue.
| 'customer', | ||
| 's_core_shops', | ||
| 'customerlanguageshop', | ||
| 'customer.language = customerlanguageshop.id' |
There was a problem hiding this comment.
Could you please update the failing test for this change? It still checks the old behavior that your PR fixes.
There was 1 failure:
1) Tests\Functional\Service\LanguageServiceTest::testReadIncludesCustomerLocalesOutsideShopLocales
Failed asserting that an array contains 'zz-ZZ'.
Tests/Functional/Service/LanguageServiceTest.php:49
| 'customer', | ||
| 's_core_shops', | ||
| 'customerlanguageshop', | ||
| 'customer.language = customerlanguageshop.id' |
There was a problem hiding this comment.
Please add a test for this customer language mapping 🙂
| 'customerlanguageshop', | ||
| 'customer.language = customerlanguageshop.id' | ||
| ); | ||
|
|
There was a problem hiding this comment.
The codestyle_php pipeline reports no_whitespace_in_blank_line in both changed files. Removing the spaces on the empty lines should fix that.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
when migrating, unnecessary / unused languages are created. this is due to the mapping of customer.language which maps to the shopid and not the localeid.
this causes SWAG_MIGRATION_WRITE_EXCEPTION errors, because it assigns a wrong language id to the customer, so the customer cant be created and their order neither as well.
[/languageId] The language "019e88ab8071730686a04a88ca695f99" is not assigned to the sales channel. in /var/www/vhosts/c8yb4.creoline.cloud/httpdocs/vendor/shopware/core/Framework/DataAbstractionLayer/Write/WriteContext.php:46
Converted data (JSON):
/**
Id of the language sub shop
var string
Orm\Column(name="language", type="string", length=10, nullable=false)
*/
private $languageId = '1';