Project

General

Profile

Actions

Bug #47192

closed

setRespectSysLanguage(FALSE) doesn't prevent language overlay when fetching localized objects

Added by Rony Khoury about 11 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Could have
Assignee:
-
Category:
Extbase + l10n
Target version:
-
Start date:
2013-04-13
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

My understanding of $query->setRespectSysLanguage(FALSE); is the following: when this flag is set, the repository should ignore any language settings and just return the plain data behind a given UID.

While trying to recreate the behavior mentioned in Bug #26852, I found that setting $query->setRespectSysLanguage(FALSE); does not prevent the returned data from being localized.

Example Repository method:

/**
 * get raw data
 *
 * @param integer $uid The identifier of the object to find
 * @return array he matching object if found, otherwise NULL
 */
public function findRawByUid($uid)
{
    $query = $this->createQuery();
    $query->getQuerySettings()->setRespectSysLanguage(FALSE);
    $query->getQuerySettings()->setRespectStoragePage(FALSE);
    $query->getQuerySettings()->setReturnRawQueryResult(TRUE);

    $object = $query->matching(
        $query->equals('uid', $uid)
    );

    $object = $query->execute();

    return $object;
}

Let's say we have two database entries with UID 1 as the original (english) entry and one with UID 3 as the localized version of the same entry (danish).

Calling $this->testItemRepository->findRawByUid(1); in the FE with URL Parameter &L=1 (page translated to danish) it returns the following array:

array(1 item)
   0 => array(25 items)
      uid => '1' (1 chars)
      pid => '73' (2 chars)
      tstamp => '1364428533' (10 chars)
      crdate => '1364425144' (10 chars)
      cruser_id => '1' (1 chars)
      deleted => '0' (1 chars)
      hidden => '0' (1 chars)
      starttime => '0' (1 chars)
      endtime => '0' (1 chars)
      lastname => 'Mustermann Dansk' (16 chars)
      t3ver_oid => '0' (1 chars)
      t3ver_id => '0' (1 chars)
      t3ver_wsid => '0' (1 chars)
      t3ver_label => '' (0 chars)
      t3ver_state => '0' (1 chars)
      t3ver_stage => '0' (1 chars)
      t3ver_count => '0' (1 chars)
      t3ver_tstamp => '0' (1 chars)
      t3ver_move_id => '0' (1 chars)
      t3_origuid => '1' (1 chars)
      sys_language_uid => '1' (1 chars)
      l10n_parent => '1' (1 chars)
      l10n_diffsource => 'a:7:{s:16:"sys_language_uid";s:1:"0";s:11:"l10n_par
         ent";s:1:"0";s:9:"firstname";s:11:"Max English
         ";s:8:"lastname";s:18:"Mustermann English";s:6:&quo
         t;hidden";s:1:"0";s:9:"starttime";s:1:"0" 
         ;s:7:"endtime";s:1:"0";}' (208 chars)
      firstname => 'Max Dansk' (9 chars)
      _LOCALIZED_UID => '3' (1 chars)

Instead of getting the english version I get the translated one.

Calling the same page in the default language (&L=0) it returns the correct raw data:

array(1 item)
   0 => array(24 items)
      uid => '1' (1 chars)
      pid => '73' (2 chars)
      tstamp => '1364427396' (10 chars)
      crdate => '1364413354' (10 chars)
      cruser_id => '1' (1 chars)
      deleted => '0' (1 chars)
      hidden => '0' (1 chars)
      starttime => '0' (1 chars)
      endtime => '0' (1 chars)
      lastname => 'Mustermann English' (18 chars)
      t3ver_oid => '0' (1 chars)
      t3ver_id => '0' (1 chars)
      t3ver_wsid => '0' (1 chars)
      t3ver_label => '' (0 chars)
      t3ver_state => '0' (1 chars)
      t3ver_stage => '0' (1 chars)
      t3ver_count => '0' (1 chars)
      t3ver_tstamp => '0' (1 chars)
      t3ver_move_id => '0' (1 chars)
      t3_origuid => '0' (1 chars)
      sys_language_uid => '0' (1 chars)
      l10n_parent => '0' (1 chars)
      l10n_diffsource => 'a:1:{s:6:"hidden";N;}' (21 chars)
      firstname => 'Max English' (11 chars)

To cut a long story short, $query->setRespectSysLanguage(FALSE); doesn't seem to work.


Related issues 2 (1 open1 closed)

Related to TYPO3 Core - Bug #45873: querySettings setRespectSysLanguage or setSysLanguageUid does not workNeeds Feedback2013-02-27

Actions
Related to TYPO3 Core - Bug #82363: Make Extbase translation handling consistent with typoscriptClosedTymoteusz Motylewski2017-09-07

Actions
Actions #1

Updated by Rony Khoury about 11 years ago

  • Assignee set to Rony Khoury

Quick Update (and memo for me): the problem is not $query->setRespectSysLanguage(FALSE). This works fine.

I'm currently debugging the methods getObjectDataByQuery() and doLanguageAndWorkspaceOverlay() in class TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend.

Actions #2

Updated by Alexander Schnitzler almost 11 years ago

  • Target version changed from Extbase 6.1 to Extbase 6.2
Actions #3

Updated by Anja Leichsenring almost 11 years ago

  • Target version changed from Extbase 6.2 to Extbase 6.3
Actions #4

Updated by Gerrit Code Review almost 11 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/21322

Actions #5

Updated by Stanislas Rolland almost 11 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #6

Updated by Gerrit Code Review over 10 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_6-1 has been pushed to the review server.
It is available at https://review.typo3.org/22421

Actions #7

Updated by Stanislas Rolland over 10 years ago

  • Status changed from Under Review to Resolved
Actions #8

Updated by Gerrit Code Review over 10 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_6-0 has been pushed to the review server.
It is available at https://review.typo3.org/22422

Actions #9

Updated by Stanislas Rolland over 10 years ago

  • Status changed from Under Review to Resolved
Actions #10

Updated by Anja Leichsenring over 10 years ago

  • Status changed from Resolved to New
  • Assignee deleted (Rony Khoury)
Actions #11

Updated by Marc Bastian Heinrichs over 10 years ago

  • Status changed from New to Accepted
  • % Done changed from 100 to 0
Actions #12

Updated by Gerrit Code Review over 10 years 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 https://review.typo3.org/23036

Actions #13

Updated by Felix Oertel over 10 years ago

  • Status changed from Under Review to Needs Feedback
  • Priority changed from Should have to Could have
  • Target version changed from Extbase 6.3 to Extbase 6.2
  • Tags set to ecs13ws

Hey,

I am not quite sure, if this is incorrect behaviour. setRespectSysLanguage(), much like setRespectStoragePid() does, only tells the backend wether or not to fetch data outside the current language. Don't know from the top of my head, if it should mean "do not translate" as well ...

We will discuss this at #ecs13ws.

Actions #14

Updated by Gerrit Code Review over 10 years ago

  • Status changed from Needs Feedback to Under Review

Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23036

Actions #15

Updated by Stefan Neufeind over 10 years ago

Review #23036 adds a separate setting "preventLanguageOverlay" (as a "feature"). Background is that respectSysLanguage was never meant to be used the way it was in the basic version of this issue here. Preventing the language-overlay is what was meant here, and that's "a new feature".

Actions #16

Updated by Gerrit Code Review over 10 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23036

Actions #17

Updated by Stanislas Rolland over 10 years ago

Felix Oertel wrote:

Hey,

I am not quite sure, if this is incorrect behaviour. setRespectSysLanguage(), much like setRespectStoragePid() does, only tells the backend wether or not to fetch data outside the current language. Don't know from the top of my head, if it should mean "do not translate" as well ...

We will discuss this at #ecs13ws.

Any solution resulting from these discussions?

Actions #18

Updated by Stanislas Rolland about 10 years ago

I think this may be closed as resolved.

Actions #19

Updated by Stefan Neufeind about 10 years ago

  • Status changed from Under Review to Resolved
Actions #20

Updated by Rob De Vries about 10 years ago

This issue is imho not resolved.
Just installed 6.2 rc1 and this issue stil exist.

The only patch that seems to resolve this is: https://review.typo3.org/#/c/22421/
but as far as i can tell, this is not merged in any release for TYPO3 6.2

I don't mind to patch Typo3DbBackend with each new release, but I think it is confusing.

Can someone tell what has been decided on this?

Tnx

Actions #21

Updated by Stefan Neufeind about 10 years ago

For master (6.2) it was merged https://review.typo3.org/21322 and reverted https://review.typo3.org/22670
As you can see there were issues with this patch.

Comment 15 mentions https://review.typo3.org/23036 - but that one was abandoned?

Actions #22

Updated by Stefan Neufeind about 10 years ago

  • Status changed from Resolved to Needs Feedback

Last thing I read from https://review.typo3.org/23036 was that Stanislas wanted to provide a new patch. Imho let's wait for his feedback.

Actions #23

Updated by Stanislas Rolland about 10 years ago

This issue was resolved only for a special case where the overlay records are in a table different than the original records, such as pages_language_overlay. The change for this special case (https://review.typo3.org/#/c/28333/) was merged.

The more general case is not resolved. The solution I proposed for this issue (https://review.typo3.org/#/c/23036/) could not get the required consensus in the review process for seven months. Therefore, I decided to abandon it. Perhaps, someone can come up with a more agreeable solution.

Actions #24

Updated by Alexander Opitz over 9 years ago

  • Project changed from 534 to TYPO3 Core
  • Category deleted (Extbase)
  • Status changed from Needs Feedback to New
  • Target version changed from Extbase 6.2 to 7.0
  • TYPO3 Version set to 6.2
  • Is Regression set to No
Actions #25

Updated by Gerrit Code Review over 9 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/33485

Actions #26

Updated by Gerrit Code Review over 9 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/33485

Actions #27

Updated by Gerrit Code Review over 9 years ago

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/33567

Actions #28

Updated by Gerrit Code Review over 9 years ago

Patch set 2 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/33567

Actions #29

Updated by Gerrit Code Review over 9 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/33485

Actions #30

Updated by Gerrit Code Review over 9 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/33485

Actions #31

Updated by Mathias Schreiber over 9 years ago

  • Target version changed from 7.0 to 7.1 (Cleanup)
Actions #32

Updated by Benni Mack almost 9 years ago

  • Target version changed from 7.1 (Cleanup) to 7.4 (Backend)
Actions #33

Updated by Gerrit Code Review almost 9 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/33485

Actions #34

Updated by Gerrit Code Review almost 9 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/33485

Actions #35

Updated by Gerrit Code Review almost 9 years ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/33485

Actions #36

Updated by Gerrit Code Review almost 9 years ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/33485

Actions #37

Updated by Gerrit Code Review almost 9 years ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/33485

Actions #38

Updated by Gerrit Code Review almost 9 years ago

Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/33485

Actions #39

Updated by Gerrit Code Review almost 9 years ago

Patch set 11 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/33485

Actions #40

Updated by Gerrit Code Review almost 9 years ago

Patch set 12 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/33485

Actions #41

Updated by Gerrit Code Review almost 9 years ago

Patch set 13 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/33485

Actions #42

Updated by Susanne Moog over 8 years ago

  • Target version changed from 7.4 (Backend) to 7.5
Actions #43

Updated by Benni Mack over 8 years ago

  • Target version changed from 7.5 to 7 LTS
Actions #44

Updated by Helmut Hummel over 8 years ago

  • Target version changed from 7 LTS to 8 LTS
Actions #45

Updated by Thomas Hucke over 8 years ago

What a pity D:

Target version changed from 7 LTS to 8

It's no good sign for international users moving that fix away from the next LTS - my point of view.

Actions #46

Updated by Christoph Bessei over 8 years ago

No chance getting this into 7 LTS?
Since it's a bugfix and not a feature it shouldn't be affected by the feature freeze of 7 LTS.

Actions #47

Updated by Georg Kühnberger over 8 years ago

Please re-consider the decission to NOT fix this issue for the current LTS = 7, but rather in 8 (LTS).

Postponing provided fixes for bugs, that popped up 2 years ago, not being solved in the Core,
leads to useless waste of time for TYPO3-6/7LTS Instance-Mantainers, as we do have to provide additional bugfix-patches for YEARS.

Thanks for reconsidering.

Actions #48

Updated by Rafal Brzeski almost 8 years ago

Hello,
please keep this patch for 7 LTS, do not make us wait longer for it.

Actions #49

Updated by Mathias Schreiber over 7 years ago

  • Status changed from Under Review to Accepted
Actions #50

Updated by Benni Mack about 7 years ago

  • Target version changed from 8 LTS to Candidate for patchlevel
Actions #51

Updated by Benni Mack almost 7 years ago

  • Category set to Extbase
Actions #52

Updated by Riccardo De Contardi over 6 years ago

  • Category changed from Extbase to Extbase + l10n
Actions #53

Updated by Tymoteusz Motylewski over 6 years ago

  • Status changed from Accepted to In Progress

please check solution provided in https://review.typo3.org/#/c/53974/ . Having the patch applied please set languageOverlayMode to false.
In my opinion we don't need yet another querySettings configuration.

Actions #54

Updated by Tymoteusz Motylewski over 6 years ago

  • Status changed from In Progress to Needs Feedback
Actions #55

Updated by Tymoteusz Motylewski over 6 years ago

  • Related to Bug #82363: Make Extbase translation handling consistent with typoscript added
Actions #56

Updated by Riccardo De Contardi over 6 years ago

  • Status changed from Needs Feedback to Closed
  • Target version deleted (Candidate for patchlevel)

I close this one for lack of feedback and because a different solution has been provided; please test https://review.typo3.org/#/c/53974/ and continue the discussion on https://forge.typo3.org/issues/82363.

If you think that this is the wrong decision, please reopen or open a different issue with a reference to this one. Thank you!

Actions

Also available in: Atom PDF