Bug #22406

select.languageField only works with config.sys_language_overlay = 0 in other tables than tt_content

Added by Oliver Weiss almost 9 years ago. Updated 4 months ago.

Status:
Needs Feedback
Priority:
Should have
Assignee:
-
Category:
Localization
Target version:
-
Start date:
2010-04-09
Due date:
% Done:

0%

TYPO3 Version:
4.5
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

I tried to get records from other tables than tt_content, i.e. tt_news via typoscript:

config {
linkVars = L
sys_language_overlay = 0
sys_language_uid = 0
language = de
locale_all = de_DE
}

[globalVar = GP:L = 1]
config.sys_language_uid = 1
config.locale_all = en_GB
config.language = en
[global]

page = PAGE
page.typeNum = 0
page.20 = CONTENT
page.20 {
table = tt_news
select {
languageField = sys_language_uid
}
renderObj = TEXT
renderObj.field = name
renderObj.wrap = |<br>
}

That works: Only translated tt_news records are displayed.
But if I set sys_language_overlay = 1 or sys_language_overlay = hideNonTranslated, it doesn't work: all records of the default language, which is german in this case, are displayed.

TCA settings in tt_news is correct, of course:

TCA.tt_news.ctrl {
transOrigPointerField = l18n_parent
transOrigDiffSourceField = l18n_diffsource
languageField = sys_language_uid
...
}

(issue imported from #M14042)

History

#1 Updated by Paints over 8 years ago

I can confirm this. I have this bug also with tt_content table.

#2 Updated by Paints over 8 years ago

Sorry, tt_content works.
My fault was, that I am using a plugin and this plugin refers to its current record.
In $GLOBALS['TSFE']->currentRecord there is always the uid and not the localized uid. This has to be localized manually.

#4 Updated by Stephan Vidar over 8 years ago

I have a similar problem with tt_content table. Only records with default language (id:0) or all-language (id:-1) are in result of query (regardless which sys_language_uid is set).

config {
linkVars = L
sys_language_mode = content_fallback
sys_language_overlay = hideNonTranslated
}

[globalVar = GP:L=1]
config {
sys_language_uid = 1
language = en
locale_all = {$locale_all_en}
htmlTag_langKey = en_EN
}
[global]

tmp = CONTENT
tmp {
table = tt_content
select {
languageField = sys_language_uid
orderBy = tstamp DESC
pidInList = 1
recursive = 10
max = 5
}

...
}

#5 Updated by Natalie about 8 years ago

I can confirm Stephan Vidar's issue. It's exactly the same here.

#6 Updated by Daniel Huf about 8 years ago

Is it possible that it's still in 4.5.2...

#7 Updated by Soeren Kracker over 7 years ago

  • Target version deleted (0)

still a problem in 4.5.6

I helped me out with this (without using languageField):

andWhere.dataWrap = sys_language_uid = {GP:L} OR sys_language_uid = -1
max = 1

#8 Updated by Alexander Opitz over 4 years ago

  • Description updated (diff)
  • Status changed from New to Needs Feedback
  • TYPO3 Version set to 4.5
  • Is Regression set to No

Hi,

does the problem still exists within newer versions of TYPO3 CMS (6.2.9)?

#9 Updated by Urs Braem about 4 years ago

In my case, select.languageField = 0 would have no effect with sys_language_overlay = 1. If available, a localisation is still output. Bug or feature?

I tried to reproduce the des in a 6.2.7 site (as encountered it - or something similar - in a 4.5.39 site).

Funny enough, in that config, even the workaround from Soeren, which worked for me in the 4.5 site

select {
pidInList = {$pidHome}
//languageField = 0
andWhere = sys_language_uid = 0
max = 1
where = colPos = 4
selectFields = header
}

would always return the localised record (sys_language_overlay = 1 in both setups)

#10 Updated by Alexander Opitz almost 4 years ago

  • Category set to Localization
  • Status changed from Needs Feedback to New

#11 Updated by Benni Mack 4 months ago

  • Status changed from New to Needs Feedback

hey everybody,

we've made improvements to `select.languageField` in v7 and also reworked the language handling TypoScript settings in v9. Can you please check if your issues are solved with our latest versions? Thanks for feedback!

Also available in: Atom PDF