[TYPO3-core] RFC: #9975: Bugfix: Typoscript: CONTENT | slide: multilanguage not correctly respected in content_fallback mode
Bernhard Kraft
kraftb at kraftb.at
Wed Apr 22 22:13:43 CEST 2009
Hello Stefan !
Be aware everyone! Do not expect to understand everything in this mail
if you are already up for more than 10 hours!! ;)
Stefan Galinski schrieb:
> Problem:
> The sliding functionality doesn't respect the content_fallback mode
> correctly. It delivers always content elements from the fallback/calculated
> language of the current selected page. The attached patch fixes this bug by
> an additional overlay check of the page record which is referenced by the
> content element.
The problem is relatively complex. It shoul be clarified that there are
two different ways of how the scenario "language" + "sliding" could get
handled/interpreted:
------------------------------------------------------------------------
*A* Slide down the rootline, until you find a page with current
language. If nothing is found, eventually slide down the rootline again
looking for elements of "content_fallback" language.
*B* Slide down the rootline, and on every depth check if there are
elements which could satisfy current "content_fallback" settings.
------------------------------------------------------------------------
The situation YOU described only occurs, when you have set
config.sys_language_mode = content_fallback
config.sys_language_overlay = 1
But you are correct: If you have &L=1 in your URL and visit a page which
hasn't got a translation, then the fallback mode will switch
TSFE->sys_language_content to "0" (lets assume this easy case - when
there are only two languages) ...
now when sliding-back happens, it will always try to use content
elements with sys_language_uid=0 ... altough &L=1 was passed .... to
describe the problem somewhat easier ...
You patch properly fixes this problem, and I have no objections if you
are going to commit it this way. It will implement type *B*. So +1 from
me for your patch!!!
But it should get noted that the feature "sliding" + "languages" is not
completly finished with this patch.
Be aware: this does not cover all possible ways of translating a page.
It could be, someone didn't set "sys_language_overlay = 1". When this
flag IS set (like in your case), TYPO3 usually fetches all content
elements with sys_language_uid=0, and the performs the overlay.
So in this case it is a "must" that you translate your default-language
elements to the alternative language. So if you have 3 default-language
elements for example, you can't have 4 translated elements ...
(sys_language_parent of tt_content gets used here) ...
But if sys_language_overlay is NOT set, the CONTENT cObj usually simply
pulls all content elements having the requested sys_language_uid
directly, without overlay. In this case sliding-backwards now becomes
problematic. One would have to "re"-set TSFE->sys_language_content for
every depth again (storing the original value), to check if there are
content elements (to implement type *B*)
So you see - it can get VERY tricky. Above descriptions only solve
variant *B* - it could still be someone requests variant *A* and we are
all totally fu**** up !!!
But anyways: you have a +1 from me to commit your variant to 4.3
(trunk), as it "slightly" changes behaviour it should not go into 4.2
greets,
Bernhard
--
Freiheit ist immer Freiheit des Andersdenkenden.
Rosa Luxemburg, 1871-1919
--------------------------------------------------
www.think-open.at
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3246 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20090422/979f4891/attachment-0001.bin
More information about the TYPO3-team-core
mailing list