Bug #47192

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

Added by Rony Khoury over 6 years ago. Updated over 1 year ago.

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

0%

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

Related to TYPO3 Core - Bug #45873: querySettings setRespectSysLanguage or setSysLanguageUid does not work Closed 2013-02-27
Related to TYPO3 Core - Bug #82363: Make Extbase translation handling consistent with typoscript Closed 2017-09-07
Blocks Nested Content Elements - Bug #64311: Translating a container Accepted 2015-01-16

Associated revisions

Revision ef71d616 (diff)
Added by Stanislas Rolland about 6 years ago

[BUGFIX] setRespectSysLanguage(FALSE) doesn't prevent language overlay

Solution: When this flag is set to FALSE, do not apply language
overlays.

Resolves: #47192
Releases: 6.0, 6.1, 6.2
Change-Id: Iac0d647fde2f930a63bc6982472b1c76e649601d
Reviewed-on: https://review.typo3.org/21322
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
Reviewed-by: Paul Dubuc
Tested-by: Paul Dubuc
Reviewed-by: Stanislas Rolland
Tested-by: Stanislas Rolland

Revision 58c9017f (diff)
Added by Stanislas Rolland about 6 years ago

[BUGFIX] setRespectSysLanguage(FALSE) doesn't prevent language overlay

Solution: When this flag is set to FALSE, do not apply language
overlays.

Resolves: #47192
Releases: 6.0, 6.1, 6.2
Change-Id: Iac0d647fde2f930a63bc6982472b1c76e649601d
Reviewed-on: https://review.typo3.org/22421
Reviewed-by: Stanislas Rolland
Tested-by: Stanislas Rolland

Revision c68b4b0d (diff)
Added by Stanislas Rolland about 6 years ago

[BUGFIX] setRespectSysLanguage(FALSE) doesn't prevent language overlay

Solution: When this flag is set to FALSE, do not apply language
overlays.

Resolves: #47192
Releases: 6.0, 6.1, 6.2
Change-Id: Iac0d647fde2f930a63bc6982472b1c76e649601d
Reviewed-on: https://review.typo3.org/22422
Reviewed-by: Stanislas Rolland
Tested-by: Stanislas Rolland

Revision bfaca9fe (diff)
Added by Andreas Wolf about 6 years ago

[BUGFIX] Test regression from patch for #47192

This fixes a unit test regression introduced with the solution for
#47192.

Change-Id: I0e70b916f24fada7f76e7fd835d31e54ca41a402
Related: #47192
Releases: 6.2, 6.1, 6.0
Reviewed-on: https://review.typo3.org/22461
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind

Revision 30a9555e (diff)
Added by Andreas Wolf about 6 years ago

[BUGFIX] Test regression from patch for #47192

This fixes a unit test regression introduced with the solution for
#47192.

Change-Id: I0e70b916f24fada7f76e7fd835d31e54ca41a402
Related: #47192
Releases: 6.2, 6.1, 6.0
Reviewed-on: https://review.typo3.org/22461
Reviewed-on: https://review.typo3.org/22575
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind

Revision 2d0997ec (diff)
Added by Andreas Wolf about 6 years ago

[BUGFIX] Test regression from patch for #47192

This fixes a unit test regression introduced with the solution for
#47192.

Change-Id: I0e70b916f24fada7f76e7fd835d31e54ca41a402
Related: #47192
Releases: 6.2, 6.1, 6.0
Reviewed-on: https://review.typo3.org/22576
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind

History

#1 Updated by Rony Khoury over 6 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.

#2 Updated by Alexander Schnitzler over 6 years ago

  • Target version changed from Extbase 6.1 to Extbase 6.2

#3 Updated by Anja Leichsenring about 6 years ago

  • Target version changed from Extbase 6.2 to Extbase 6.3

#4 Updated by Gerrit Code Review about 6 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

#5 Updated by Stanislas Rolland about 6 years ago

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

#6 Updated by Gerrit Code Review about 6 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

#7 Updated by Stanislas Rolland about 6 years ago

  • Status changed from Under Review to Resolved

#8 Updated by Gerrit Code Review about 6 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

#9 Updated by Stanislas Rolland about 6 years ago

  • Status changed from Under Review to Resolved

#10 Updated by Anja Leichsenring about 6 years ago

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

#11 Updated by Marc Bastian Heinrichs about 6 years ago

  • Status changed from New to Accepted
  • % Done changed from 100 to 0

#12 Updated by Gerrit Code Review about 6 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

#13 Updated by Felix Oertel about 6 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.

#14 Updated by Gerrit Code Review about 6 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

#15 Updated by Stefan Neufeind about 6 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".

#16 Updated by Gerrit Code Review about 6 years ago

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

#17 Updated by Stanislas Rolland over 5 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?

#18 Updated by Stanislas Rolland over 5 years ago

I think this may be closed as resolved.

#19 Updated by Stefan Neufeind over 5 years ago

  • Status changed from Under Review to Resolved

#20 Updated by Rob De Vries over 5 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

#21 Updated by Stefan Neufeind over 5 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?

#22 Updated by Stefan Neufeind over 5 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.

#23 Updated by Stanislas Rolland over 5 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.

#24 Updated by Alexander Opitz almost 5 years ago

  • Project changed from Extbase MVC Framework 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

#25 Updated by Gerrit Code Review almost 5 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

#26 Updated by Gerrit Code Review almost 5 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

#27 Updated by Gerrit Code Review almost 5 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

#28 Updated by Gerrit Code Review almost 5 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

#29 Updated by Gerrit Code Review over 4 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

#30 Updated by Gerrit Code Review over 4 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

#31 Updated by Mathias Schreiber over 4 years ago

  • Target version changed from 7.0 to 7.1 (Cleanup)

#32 Updated by Benni Mack about 4 years ago

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

#33 Updated by Gerrit Code Review about 4 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

#34 Updated by Gerrit Code Review about 4 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

#35 Updated by Gerrit Code Review about 4 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

#36 Updated by Gerrit Code Review about 4 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

#37 Updated by Gerrit Code Review about 4 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

#38 Updated by Gerrit Code Review about 4 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

#39 Updated by Gerrit Code Review about 4 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

#40 Updated by Gerrit Code Review about 4 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

#41 Updated by Gerrit Code Review about 4 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

#42 Updated by Susanne Moog about 4 years ago

  • Target version changed from 7.4 (Backend) to 7.5

#43 Updated by Benni Mack almost 4 years ago

  • Target version changed from 7.5 to 7 LTS

#44 Updated by Helmut Hummel almost 4 years ago

  • Target version changed from 7 LTS to 8 LTS

#45 Updated by Thomas Hucke almost 4 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.

#46 Updated by Christoph Bessei almost 4 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.

#47 Updated by Georg Kühnberger over 3 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.

#48 Updated by Rafal Brzeski over 3 years ago

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

#49 Updated by Mathias Schreiber over 2 years ago

  • Status changed from Under Review to Accepted

#50 Updated by Benni Mack over 2 years ago

  • Target version changed from 8 LTS to Candidate for patchlevel

#51 Updated by Benni Mack over 2 years ago

  • Category set to Extbase

#52 Updated by Riccardo De Contardi almost 2 years ago

  • Category changed from Extbase to Extbase + l10n

#53 Updated by Tymoteusz Motylewski almost 2 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.

#54 Updated by Tymoteusz Motylewski almost 2 years ago

  • Status changed from In Progress to Needs Feedback

#55 Updated by Tymoteusz Motylewski almost 2 years ago

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

#56 Updated by Riccardo De Contardi over 1 year 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!

Also available in: Atom PDF