View Issue Details

IDProjectCategoryView StatusLast Update
0006846OXID eShop (all versions)4.12. Subshop handlingpublic2018-06-21 10:56
Reporteranton.fedurtsya 
PriorityhighSeverityminorReproducibilityalways
Status acknowledgedResolutionopen 
Product Version6.0.2 
Target VersionFixed in Version 
Summary0006846: Wrong language id used in views fields generation
DescriptionWrong language id is used in views fields linking when we have a gap in language ids, like 0, 1, 2, 4 (no 3), so for last language the field ids will be wrong.
Steps To ReproduceEnsure you have some 3 or more languages in subshop: de(0), en(1), ru(2)
Regenerate views, so you can see correct ids are used for "ru" language views:
select `oxarticles`.`OXID` AS `OXID`, ... `oxarticles`.`OXTITLE_2` AS `OXTITLE` ...

Remove some not first and not last language, in our case only "en" fits the requirement.
Run console views regeneration command, or in admin, activate some other then "subshop" shop, and run views regeneration in mall.
You can see wrong language fields are used for "ru" language views:

select `oxarticles`.`OXID` AS `OXID`, ... `oxarticles`.`OXTITLE_1` AS `OXTITLE` ...

which is wrong, and will cause huge problems on more complex shops.
Additional InformationThe method OxidEsales\EshopCommunity\Core\Language::getLanguageIds name is missleading, it do not care about the actual id's of the languages, but just gives the list of languages somehow calculated from several shops. The problem is - what method returns while used with shopId which doesnt match current active shop id. Need to check this case everywhere in code, but looks like its only used in views generation.
TagsNo tags attached.
ThemeNot defined
BrowserNot defined
PHP VersionNot defined
MySQL VersionNot defined

Relationships

related to 0006081 assignedHR Views get broken when Language base IDs of specific Languages deviate in Subshops 
related to 0006080 assignedHR Subshop language destroys language handling 

Activities

anton.fedurtsya

2018-06-21 10:06

manager   ~0012516

Related pull request with views regeneration fix:

https://github.com/OXID-eSales/oxideshop_ce/pull/647