Bug #22406

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

Added by Oliver Weiss about 9 years ago. Updated 19 days 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 almost 9 years ago

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

#2 Updated by Paints almost 9 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 over 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 over 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 6 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!

#12 Updated by Riccardo De Contardi 28 days ago

I tried the following test with 9.5.5

Setup

- TYPO3 with two languages defined in the Site Configuration module

- italian (default)
- english (uid=1); with fallbacktype: strict

Full config (only relevant parts):

languages:
  -
    title: Italian
    enabled: true
    languageId: '0'
    base: /
    typo3Language: it
    locale: it_IT.UTF-8
    iso-639-1: it
    navigationTitle: Italiano
    hreflang: it-IT
    direction: ltr
    flag: it
  -
    title: English
    enabled: true
    languageId: '1'
    base: /en/
    typo3Language: default
    locale: en_EN.UTF-8
    iso-639-1: en
    navigationTitle: English
    hreflang: en-EN
    direction: ''
    fallbackType: strict
    flag: gb

- create a home page and translate it
- Install EXT:news and create a "news" sysfolder, translated (uid=5 in my case)

- write the following TypoScript setup (only relevant parts:

page=PAGE
page.15 = CONTENT
page.15 {
  table = tx_news_domain_model_news
  select {
    languageField = sys_language_uid
    pidInList = 5
  }
  renderObj = TEXT
  renderObj.field = author
  renderObj.wrap = |<br>
}

Text execution

I created some news records:

1. "Test 1" with language:"default" and with: Author Name: "Riccardo"
1.1. I translated it ("Test 1 ENG"), and set Author Name: custom value: "Richard"

2. "Test 2" with language: "all" and Author Name: "Giuseppe"

3. "Test 3" with language: "default" and Author Name: "Francesco"
3.1. I translated it ("Test 3 ENG") with Author Name: Value of default language

4. "Test 4" with language: "default" and Author Name: "Mario"

5. "Test 5" with language: "english" and Author Name: "Mary"

Results

Page in Italian Page in English
Riccardo Richard
Giuseppe
Francesco Francesco
Mario
Mary

The only result that I found to be "odd" (but I could be wrong and this behavior is correct) is the behavior of the record with language=all (-1) that is only visible in english.

#13 Updated by Riccardo De Contardi 19 days ago

[UPDATE] the record with language=all (-1) that is only visible in english (secondary language) also with fallbackType: fallback

Also available in: Atom PDF