Bug #17354
fallback for menus. "content_fallback;1,0" has no affect for page records (e.g. menu)
| Status: | Under Review | Start date: | 2007-07-22 | ||
|---|---|---|---|---|---|
| Priority: | Should have | Due date: | |||
| Assignee: | Stefan Galinski | % Done: | 90% |
||
| Category: | - | ||||
| Target version: | - | Estimated time: | 50.00 hours | ||
| TYPO3 Version: | 4.2 | Complexity: | nightmare | ||
| PHP Version: | 4.3 | ||||
| Votes: | 11 (View) |
Description
Problem:
It is not possible to define another that default language as fallback.
This is what TYPO3 does actual:
you can define
config.sys_language_mode=content_fallback;1,0
What this does is to set
$this->sys_language_content in tslib_fe.
So only the content is rendered in a alternative fallback language.
- menues fall back to default
- page title fall back to default
So this is not perfect, cause it makes no sense if menues and pagedata fall back to default but content is shown in another fallback language.
Example:
say you have default=english / 1 = spanish / 2=catalan (spanish language)
typical setting if L=2:
config {
sys_language_uid = 2
sys_language_mode=content_fallback;1,0
}
if you view a page where no catalan version is available TYPO3 shows menu title and pagetitle of defaultlanguage and only the content in spanish.
(What is far from perfect and not the expected behaviour)
Solution:
- It is neccessary that other functions in the core know a fallbackorder.
- especially the function t3lib_page::getPageOverlay needs to know alternative fallback language uids.
I recommend to introduce a new configuration:
config.sys_language_fallBackOrder=1,0
(which is used as general fallbackorder)
Attached a patch with the following changes:
t3lib_page:
1) new function getLanguageOverlayUidForPage($page_id,$fallBackOrder)
(function that checks which page record overlay language should be used, according to the given fallbackorder)
2) adjust getPageOverlay to use fallback uid instead of default
tslib_fe
1) settingLanguage():
set $this->sys_language_overlayCheckOrder
load fallback overlay for actaul page if needed
tslib_menu
1) adjust filterMenuPages to work with the changes
view attached patches
(i use head of branch 4.1)
(issue imported from #M6009)
Related issues
| related to Core - Bug #36616: TYPO3 4.7 sectionIndex not working correctly on multilang... | Resolved | 2012-04-26 | ||
| related to Core - Bug #19114: sys_language_mode does not work | Under Review | 2008-07-16 | ||
| related to Core - Bug #19718: Typoscript: CONTENT | slide: multilanguage not correctly... | Accepted | 2008-12-18 | ||
| duplicated by Core - Bug #20623: content_fallback for whole page, including navigation and... | Closed | 2009-06-16 |
History
Updated by Sareen Millet almost 6 years ago
I observed the same problem. Then I tried the suggested patches but for me they don't Work. (I use Typo3 Version 4.12)
Has anybody another solution for the problem?
Updated by Daniel Poetzinger almost 6 years ago
they should work.
did you set new setting:
config.sys_language_fallBackOrder=1,0
Updated by Sareen Millet almost 6 years ago
Hi Daniel,
I used: config.sys_language_mode = content_fallback; 1,0
Why did you change this config to
config.sys_language_fallBackOrder=1,0
I expected the patch to do the same thing as typo3 should do. So I used the normal config.
Now it's working.
Thanks.
Hope this bug is solved in the new Typo3 4.2.0 Version.
greetings
Sareen
Updated by Daniel Poetzinger over 5 years ago
Its because the sematic difference
config.sys_language_mode = content_fallback; 1,0
controls the content fallback, and the fallbackorder is not implemented in a way it could easy be used for a common fallback order.
I my opinion having that common config parameter is more clear. (It changes not only content behaviour - which can also be set to something diffrent than content_fallback - but changes common language fallback)
Updated by Andreas no-lastname-given over 5 years ago
thanx daniel!! works perfect. i also think it's better to define the fallback order in an own config property.
Updated by Sareen Millet over 5 years ago
Hi Daniel,
your patch is perfect, thank you. I played around with it for quite some time now.
There remains only one problem with realUrl. The text in the Url still has not the correct language fallBackOrder.
Is there a solution to this?
greetings
Sareen
Updated by Ronald Steiner about 5 years ago
Seams same problem occurs with:
pi_getFFvalue()
- used for FlexForm
Language fallback in steps seams to be quite some problem
Updated by Clemens Riccabona about 5 years ago
Is this coming up in 4.2? Does anybody know?
Updated by Sonja Schubert almost 5 years ago
still not in 4.2.1, please integrate this!
Updated by Daniel Poetzinger almost 5 years ago
I will soon publish the extension langaugevisibility which resolves this and a lot more:
http://www.typo3-media.com/extensions/multilanguages-websites-with-typo3-languagevisibility.html
Updated by Jonas Felix almost 5 years ago
confirm: the extension works great, we use it in two projects! This has to be integrated into the core!
Updated by Ronald Steiner almost 5 years ago
Is this extension for download and test already somewhere?
Updated by Jonas Felix almost 5 years ago
@ronald: the extension is attached to this bug report: http://bugs.typo3.org/file_download.php?file_id=2929&type=bug
Updated by Ronald Steiner almost 5 years ago
as far as I see, this is "just" the bugfix. And there will be an huge extension "languagevisibility" that solves this bug and adds a lot of features.
Updated by Jonas Felix almost 5 years ago
but shouldn't such thing be integrated in the core?
I'm realy carefull with such core changing extensions, they can lead to other problems. Is it tested with TV, Workspaces and all the other needed TYPO3 things?
Updated by Daniel Poetzinger almost 5 years ago
sure its tested with workspaces / templavoila / even introduce new templavoila features
the extension is availabe at forge: http://forge.typo3.org/projects/show/extension-languagevisibility
sildes:
http://www.typo3-media.com/extensions/multilanguages-websites-with-typo3-languagevisibility.html
Updated by Andreas no-lastname-given almost 5 years ago
thanx!! works like a charm!
Updated by Ronald Steiner over 4 years ago
Hi Daniel,
I just test your extension: languagevisability
- it seems to work fine so far, but the bug described here is not resolved, is it? Or is there a special TypoScript Configuration necessary to resolve this bug?
And it seems not possible to install that extension together with the patch you proviede here: T3X_danp_languagefallback_patch-0_0_0-z-200708151515.t3x
Schould this patch not be integrated in your extension languagevisability? Am I getting something wrong?
greetings
Ron
Updated by Ronald Steiner over 4 years ago
P.S.: For me correct language fallback in menu's is more important, so I now only use the patch and not the extension.
Updated by Michael Stucki about 4 years ago
Daniel, can you update the patch for TYPO3 4.2 please? Additionally, please check my patch in #19114.
It seems to work quite different than the solution that you have come to. What it basically does is the provide content-fallback even if the page record has been translated, but not all content on it.
Any feedback is appreciated.
- michael
Updated by Jonas Felix almost 4 years ago
It would be great if somebody could writhe a manual on how to implement translation handling for records in extensions. But a way which supports the full features of translation handling in TYPO3.
Is this integrated in the ExtBase persitence layer?
Updated by Dmitry Dulepov about 2 years ago
I attach another patch, which fixes everything.
According to the docs menu and page title should be translated as well when content_fallback is in use. This means that the page record and $TSFE->sys_language_uid should be set to a fallback language. Indirectly this is confirmed by TSRef in the description of sys_language_uid:
<blockquote>Internally, the value is depending on whether a Alternative Page Language record can be found with that language. If not, the value will default to zero (default language) except if “sys_language_mode” is set to a value like “content_fallback”.</blockquote>
and
<blockquote>The system will always operate with the selected language even if the page is not translated with a page overlay record. This will keep menus etc. translated</blockquote>
So the patch checks if the fallback is set and changes page record and sys_language_uid to be the one from fallback, which makes the behavior identical to described in TSRef.
Result: menu in the fallback language, page title in the fallback language, links still stay with user's choosen language.
One possible drawback could be with language selectors. If they use $TSFE->sys_language_uid, they will show a fallback language. Instead they should use the value of "L".
Updated by Juergen Weber about 2 years ago
- Target version deleted (
0)
I have this issue in TYPO3 version 4.5. Isn't this fixed yet? Dimitry, will your patch also work with 4.5?
Updated by amareco about 2 years ago
The problem is´nt fixed in Typo3 4.5.2 but the patch works there.
Updated by Philipp Idler almost 2 years ago
amareco wrote:
The problem is´nt fixed in Typo3 4.5.2 but the patch works there.
what patch? dmitry's?
doesn't work for me (4.5.3)
i don't understand why this isn't part of the core...
Updated by Evgeniy Martynov almost 2 years ago
Hi,
Dmitry Dulepov wrote:
I attach another patch, which fixes everything. ...
I checked both solutions.
While danp_languagefallback_patch adrresses the issue the patch from Dmitrij does not at all.
The main problem is not translation of the currently selected page record (while in content_fallback mode), but rather falling back while translating menu items for other pages which are present in the menu.
Dmitrij's patch works only with currently selected page, while danp_languagefallback_patch reimplements getPageOverlay which actually provides menu biulding class with translated page records.
Updated by Dmitry Dulepov over 1 year ago
- Category deleted (
Communication)
Dan's patch is incorrect because it adds a dependency from t3lib_page to TSFE. This should not happen. There must be a different solution.
Updated by Henrik Ziegenhain about 1 year ago
Any news on this issue?
It`s still reproducable in 4.6.6
Updated by Stefan Galinski about 1 year ago
- File l10nFallback.patch added
I have written a small patch for the site [[http://www.ashtangayoga.info/]] last week that consideres the configured content_fallback setting for pages too. Furthermore it introduces a new API method to overlay other non-page records with a possible fallback, but you must modify the necessary extensions yourself. It's already done for the core and so that stuff should already work in most cases. Just have a look at the patch for more details. Feedback is welcome and maybe this simple patch or a modification of it can be submitted to Gerrit sooner or later.
Updated by Henrik Ziegenhain about 1 year ago
Hi Stefan,
meanwhile I tested Dmitrys patch - It solves the main problem with non translated navigations, but there are strange side effects I can`t discribe.
I will give your patch shortly a try - would be great to see this in core.
Updated by Henrik Ziegenhain about 1 year ago
Hi Stefan,
I set up an test installation and imported my site (12 Languages!).
Everything is working as expected after applying your patch.
From my humble point of view you maybe could submit it to Gerrit.
PS: I think this is also related to #20623
Updated by Stefan Galinski about 1 year ago
- Status changed from New to Accepted
- Assignee set to Stefan Galinski
Hi Henrik,
I marked #20623 as a duplicate of this one and will submit the patch to Gerrit for 4.8 only (and 4.5/4.6 backports afterwards if Ernesto/Xavier want it) in some days to get some more feedback and practical results as the patch is already running in a live installation. Thanks for your review! :-)
Updated by Stefan Galinski about 1 year ago
Hi Henrik,
I fixed a possible edge-case in the patch and will upload this to one to Gerrit now. Please review it again carefully, just to be sure that nothing else slipped in and don't forget voting in Gerrit. Thanks in advance! :-)
Edit: Everyone and not just Hendrik is invited to do the same. ;-)
Updated by Gerrit Code Review about 1 year ago
- Status changed from Accepted to Under Review
Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9937
Updated by Henrik Ziegenhain about 1 year ago
Thanks Stefan,
+1 by reading - Is there a way to download the changes as patch-file to apply it to my local installation?
I did not really deal with the new review system before. Sorry.
After a short test I will give my vote in Gerrit.
Updated by Stefan Galinski about 1 year ago
- File l10nFallback.patch added
I attached the new version of the patch directly taken from Gerrit by using the patch command. To get such a patch by yourself, you just need to clone the git repository of TYPO3 and execute one of the mentioned commands below a patchset in Gerrit on the sources.
Updated by Stefan Galinski about 1 year ago
- % Done changed from 0 to 90
- Estimated time set to 50.00
- Complexity set to nightmare
Updated by Daniel Poetzinger about 1 year ago
Why not using languagevisibility? :-) Its all working there and a lot of more things..
Just my 2 cents :-)
Updated by Gerrit Code Review about 1 year ago
Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9937
Updated by Stefan Galinski about 1 year ago
Hi Daniel,
Your extension does lot's of more stuff and that's exactly the problem. Also I didn't understood the code and it didn't worked for me like I had expected it (just install it, define the fallback order and go).
Updated by Gerrit Code Review about 1 year ago
Patch set 3 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9937
Updated by Henrik Ziegenhain about 1 year ago
Push :)
Stefan and Ronald, could you please also look at the new patch from Markus?
Updated by Gerrit Code Review 11 months ago
Patch set 4 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9937
Updated by Stefan Regniet 10 months ago
Hi together. Just tested the patch on a page with > 40 languages (on a patched 4.7.2). Works fine so far.
But it seems that it ignores l18n_cfg setting (2) in page-record (Hide page if no translation is available).
So I don't have any chance to explicitly hide certain pages that I don't want to show in fallback.
That one should be patched in t3lib_page imho... Thanks :)
Updated by Stefan Galinski 9 months ago
Really? This setting works for me!? Please test the latest version of the patch. Will be there in a few minutes... :-)
Updated by Gerrit Code Review 9 months ago
Patch set 5 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9937
Updated by Gerrit Code Review 9 months ago
Patch set 6 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9937
Updated by Gerrit Code Review 9 months ago
Patch set 7 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9937
Updated by Gerrit Code Review 9 months ago
Patch set 8 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9937
Updated by Gerrit Code Review 9 months ago
Patch set 9 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9937
Updated by Gerrit Code Review 9 months ago
Patch set 10 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9937
Updated by Gerrit Code Review 9 months ago
Patch set 11 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9937
Updated by Gerrit Code Review 9 months ago
Patch set 12 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9937
Updated by Gerrit Code Review 8 months ago
Patch set 13 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9937
Updated by Gerrit Code Review 8 months ago
Patch set 14 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9937
Updated by Gerrit Code Review 4 months ago
Patch set 15 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/9937
Updated by Gerrit Code Review 4 months ago
Patch set 16 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/9937
Updated by Camelia M 2 months ago
Camelia M wrote:
Patch 16 seems to work fine for me. Thank you
Actually, after I apply this patch, localizations for jfmulticontent stop working. Not sure if this is the only one that stops working, but this is the first I noticed.
Updated by Camelia M 2 months ago
Camelia M wrote:
Camelia M wrote:
Patch 16 seems to work fine for me. Thank you
Actually, after I apply this patch, localizations for jfmulticontent stop working. Not sure if this is the only one that stops working, but this is the first I noticed.
I forgot to mention that I did replace getRecordOverlay function call with getRecordOverlayWithFallback