[BUGFIX] Editing title inline now updates correct language 73/48973/8
authorGianluigi Martino <gmartino27@gmail.com>
Thu, 14 Jul 2016 14:30:19 +0000 (16:30 +0200)
committerFrans Saris <franssaris@gmail.com>
Mon, 12 Sep 2016 09:41:40 +0000 (11:41 +0200)
Editing title inline in page column view updated always standard
language.
Now the title of the selected language being updated.

Resolves: #77054
Releases: master, 7.6
Change-Id: I267b374fcac4540181cf16d1d443491ad6408a0d
Reviewed-on: https://review.typo3.org/48973
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Ruud Silvrants <ruudsilvrants@gmail.com>
Tested-by: Ruud Silvrants <ruudsilvrants@gmail.com>
Reviewed-by: Frans Saris <franssaris@gmail.com>
Tested-by: Frans Saris <franssaris@gmail.com>
typo3/sysext/backend/Classes/View/PageLayoutView.php

index 8d35767..c29b5bd 100644 (file)
@@ -483,9 +483,26 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
             $userCanEditPage = $this->getBackendUser()->check('tables_modify', 'pages_language_overlay');
         }
         if ($userCanEditPage) {
+            $languageOverlayId = 0;
+            $overlayExpressionBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
+                ->getConnectionForTable('pages_language_overlay')
+                ->getExpressionBuilder();
+            $constraint = $overlayExpressionBuilder->eq(
+                'sys_language_uid',
+                (int)$this->tt_contentConfig['sys_language_uid']
+            );
+            $pageOverlayRecord = BackendUtility::getRecordsByField(
+                'pages_language_overlay',
+                'pid',
+                (int)$this->id,
+                $constraint
+            );
+            if (!empty($pageOverlayRecord[0]['uid'])) {
+                $languageOverlayId = $pageOverlayRecord[0]['uid'];
+            }
             $pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/PageActions', 'function(PageActions) {
                 PageActions.setPageId(' . (int)$this->id . ');
-                PageActions.setLanguageOverlayId(' . $this->tt_contentConfig['languageColsPointer'] . ');
+                PageActions.setLanguageOverlayId(' . $languageOverlayId . ');
                 PageActions.initializePageTitleRenaming();
             }');
         }