Bug #14623
closed
Hide page if no translation for current language exists bug
Added by Marc Wöhlken about 19 years ago.
Updated almost 18 years ago.
Description
The "Hide page if no translation for current language exists" behaves faulty if a website visitor is on a page which has no translations.
Example using english as default language and german as additonal language:
Page1
- English = Page1, German = Seite1
Page2
- English = Page2, German not available
Page3
- English = Page3, German not available
For Page 3 set "Hide page if no translation for current language exists".
When visiting Page1 everything works as expected for english / german language.
When visiting Page2 it does not when using german:
If the language is set to english everything is o.k.
If you switch to german you'll get the following menu:
Page1 - Should be Seite1
Page2 - O.K. since we get the default language
Page3 - Should be hidden since german translations are not available
(issue imported from #M908)
Files
I can reproduce the bug too. (not to difficult). This feature is still in the core (checkout cvs=01/04/05).
While debugging (class.tslib_menu.php) this, it looks that the sys_language_uid is set to "0" somewhere (don't know) when there is no translation of the page.
How should this being solved? There where is is set to 0 when there is no translation (maybe a problem for the rest of the page/site), or somewhere in the class.tslib_menu.php?
Maybe I am wrong, please correct me (still a newbie)
I just upload a patch. Can somebody of the dev team check this of this is the correct way to solve this. I'll don't know if something will break if this patch is applied. On my site everyting is still working.
This should get fixed in 3.8 Will look at it.
The fix looks good and simple enough, and it works here, too. I don't see a reason why the language should be resetted other than on the current content. I will make a few more tests and commit this if nothing breaks.
I discussed this with Kasper, and he says it's not necessarily a bug. I'll see if this situation can be avoided with proper configuration but for now this is suspended until the BDFL says otherwise.
Okay, it seems like Kasper was right (as usual) when he said this is a config issue. Please try
config.sys_language_mode = content_fallback; 0
in your template setup and see if you get the desired result. It works for me...
O.K., I'll try the suggested solution and send my feedback.
This works with proper TS setup.
Also available in: Atom
PDF