Project

General

Profile

Actions

Bug #22406

closed

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

Added by Oliver Weiss over 14 years ago. Updated over 5 years ago.

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

0%

Estimated time:
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)

Actions #1

Updated by Paints over 14 years ago

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

Actions #2

Updated by Paints over 14 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.

Actions #4

Updated by Stephan Vidar almost 14 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
}

...
}
Actions #5

Updated by Natalie almost 14 years ago

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

Actions #6

Updated by Daniel Huf over 13 years ago

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

Actions #7

Updated by Soeren Kracker about 13 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

Actions #8

Updated by Alexander Opitz almost 10 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)?

Actions #9

Updated by Urs Braem almost 10 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)

Actions #10

Updated by Alexander Opitz over 9 years ago

  • Category set to Localization
  • Status changed from Needs Feedback to New
Actions #11

Updated by Benni Mack almost 6 years 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!

Actions #12

Updated by Riccardo De Contardi over 5 years 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.

Actions #13

Updated by Riccardo De Contardi over 5 years ago

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

Actions #14

Updated by Benni Mack over 5 years ago

Hey Riccardo,

can you recheck this in v9.5.8? I think this one https://review.typo3.org/c/Packages/TYPO3.CMS/+/59993 should have fixed this issue...

Actions #15

Updated by Riccardo De Contardi over 5 years ago

I repeated the test performed on my comment 12 on TYPO3 9.5.8 - the results (with comment) are:

ITalian English Comment
Riccardo Richard Correct, the author differs from ita and eng
Giuseppe Giuseppe Correct, the news has language=All
Francesco Francesco Correct, the author in English is set as "Value of default language"
Mario Correct, the author has value only in Italian
Mary Correct, the author has value only in English

The results are the same for both fallbacktype: strict and fallbacktype: fallback

I will soon test it on version 10.0.0

Actions #16

Updated by Riccardo De Contardi over 5 years ago

I performed the same test on my comment 12 with 8.7.26, the results are:

1) Without setting sys_language_mode and sys_language_overlay:

Page in Italian Page in English
Riccardo Richard
(nothing shown) (nothing shown)
Francesco Francesco
Mario
Mary

2) With:

 sys_language_mode = content_fallback
 sys_language_overlay = hideNonTranslated 
Page in Italian Page in English
Riccardo Richard
Giuseppe Giuseppe
Francesco Francesco
Mario
(nothing shown)

3) With:

 sys_language_mode = content_fallback
 sys_language_overlay = 1 
Page in Italian Page in English
Riccardo Richard
Giuseppe Giuseppe
Francesco Francesco
Mario Mario
(nothing shown)

I don't know if other combinations should be tested and would work; I cannot test it right now with ext:news and 10.0.0 (not compatible), but I think that the same results of 9.5 applies.

Actions #17

Updated by Riccardo De Contardi over 5 years ago

  • Status changed from Needs Feedback to Closed

I close this issue as it is solved for version 9.5.x: if you think that this is the wrong decision or experience the issue again on recent TYPO3 versions, please reopen it or open a new issue with a reference to this one. Thank you.

Actions

Also available in: Atom PDF