Bug #47192
closedsetRespectSysLanguage(FALSE) doesn't prevent language overlay when fetching localized objects
0%
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.
Updated by Rony Khoury over 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.
Updated by Alexander Schnitzler over 11 years ago
- Target version changed from Extbase 6.1 to Extbase 6.2
Updated by Anja Leichsenring over 11 years ago
- Target version changed from Extbase 6.2 to Extbase 6.3
Updated by Gerrit Code Review over 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
Updated by Stanislas Rolland over 11 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset ef71d61619d7da17131c38531308d4abbfa8dbf5.
Updated by Gerrit Code Review over 11 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
Updated by Stanislas Rolland over 11 years ago
- Status changed from Under Review to Resolved
Applied in changeset 58c9017fbdeb9108c15e80de4fb726c1f9273b8b.
Updated by Gerrit Code Review over 11 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
Updated by Stanislas Rolland over 11 years ago
- Status changed from Under Review to Resolved
Applied in changeset c68b4b0d0d9ff1af00428ebef098c398f1c1f8a8.
Updated by Anja Leichsenring over 11 years ago
- Status changed from Resolved to New
- Assignee deleted (
Rony Khoury)
Updated by Marc Bastian Heinrichs over 11 years ago
- Status changed from New to Accepted
- % Done changed from 100 to 0
The patches for master, 6.1 and 6.0 were reverted in
https://review.typo3.org/#/c/22670/
https://review.typo3.org/#/c/22671/
https://review.typo3.org/#/c/22672/
Updated by Gerrit Code Review over 11 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
Updated by Felix Oertel over 11 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.
Updated by Gerrit Code Review over 11 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
Updated by Stefan Neufeind over 11 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".
Updated by Gerrit Code Review over 11 years ago
Patch set 3 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23036
Updated by Stanislas Rolland almost 11 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?
Updated by Stanislas Rolland over 10 years ago
I think this may be closed as resolved.
Updated by Stefan Neufeind over 10 years ago
- Status changed from Under Review to Resolved
Updated by Rob De Vries over 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
Updated by Stefan Neufeind over 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?
Updated by Stefan Neufeind over 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.
Updated by Stanislas Rolland over 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.
Updated by Alexander Opitz about 10 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
Updated by Gerrit Code Review about 10 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
Updated by Gerrit Code Review about 10 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
Updated by Gerrit Code Review about 10 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
Updated by Gerrit Code Review about 10 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
Updated by Gerrit Code Review almost 10 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
Updated by Gerrit Code Review almost 10 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
Updated by Mathias Schreiber almost 10 years ago
- Target version changed from 7.0 to 7.1 (Cleanup)
Updated by Benni Mack over 9 years ago
- Target version changed from 7.1 (Cleanup) to 7.4 (Backend)
Updated by Gerrit Code Review over 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
Updated by Gerrit Code Review over 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
Updated by Gerrit Code Review over 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
Updated by Gerrit Code Review over 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
Updated by Gerrit Code Review over 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
Updated by Gerrit Code Review over 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
Updated by Gerrit Code Review over 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
Updated by Gerrit Code Review over 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
Updated by Gerrit Code Review over 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
Updated by Susanne Moog over 9 years ago
- Target version changed from 7.4 (Backend) to 7.5
Updated by Benni Mack about 9 years ago
- Target version changed from 7.5 to 7 LTS
Updated by Helmut Hummel about 9 years ago
- Target version changed from 7 LTS to 8 LTS
Updated by Thomas Hucke about 9 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.
Updated by Christoph Bessei about 9 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.
Updated by Georg Kühnberger almost 9 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.
Updated by Rafal Brzeski over 8 years ago
Hello,
please keep this patch for 7 LTS, do not make us wait longer for it.
Updated by Mathias Schreiber almost 8 years ago
- Status changed from Under Review to Accepted
Updated by Benni Mack over 7 years ago
- Target version changed from 8 LTS to Candidate for patchlevel
Updated by Riccardo De Contardi about 7 years ago
- Category changed from Extbase to Extbase + l10n
Updated by Tymoteusz Motylewski about 7 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.
Updated by Tymoteusz Motylewski about 7 years ago
- Status changed from In Progress to Needs Feedback
Updated by Tymoteusz Motylewski about 7 years ago
- Related to Bug #82363: Make Extbase translation handling consistent with typoscript added
Updated by Riccardo De Contardi almost 7 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!