From b66fc9650988401941ce88dc5cdd34745d1bd981 Mon Sep 17 00:00:00 2001
From: Marvin Dettinger <mde@rtp.ch>
Date: Mon, 9 May 2016 17:38:10 +0200
Subject: [PATCH] [BUGFIX] Adds missing tablename sys_language in
 fetchOriginLanguage function

Resolves: #76098
Releases: master, 7.6
Change-Id: I4ceb644328671cd3355340d6b6991d60e88b265a
Reviewed-on: https://review.typo3.org/48046
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Reviewed-by: Christoph Kratz <ckr@rtp.ch>
Tested-by: Christoph Kratz <ckr@rtp.ch>
Reviewed-by: Marvin Dettinger <mde@rtp.ch>
Tested-by: Marvin Dettinger <mde@rtp.ch>
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
---
 .../Domain/Repository/Localization/LocalizationRepository.php  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/typo3/sysext/backend/Classes/Domain/Repository/Localization/LocalizationRepository.php b/typo3/sysext/backend/Classes/Domain/Repository/Localization/LocalizationRepository.php
index edaddb327808..d1c7e03621d3 100644
--- a/typo3/sysext/backend/Classes/Domain/Repository/Localization/LocalizationRepository.php
+++ b/typo3/sysext/backend/Classes/Domain/Repository/Localization/LocalizationRepository.php
@@ -33,11 +33,12 @@ class LocalizationRepository
     {
         $record = $this->getDatabaseConnection()->exec_SELECTgetSingleRow(
             'tt_content_orig.sys_language_uid',
-            'tt_content,tt_content AS tt_content_orig',
+            'tt_content,tt_content AS tt_content_orig,sys_language',
             'tt_content.colPos = ' . (int)$colPos
             . ' AND tt_content.pid = ' . (int)$pageId
             . ' AND tt_content.sys_language_uid = ' . (int)$localizedLanguage
             . ' AND tt_content.t3_origuid = tt_content_orig.uid'
+            . ' AND tt_content_orig.sys_language_uid=sys_language.uid'
             . $this->getExcludeQueryPart()
             . $this->getAllowedLanguagesForBackendUser(),
             'tt_content_orig.sys_language_uid'
-- 
GitLab