Commit 2ae293b2 authored by Felix Kopp's avatar Felix Kopp Committed by Christian Kuhn
Browse files

[BUGFIX] Page module title obeys language overlay

Makes the page backend module's headline language overlay aware.

The displayed headline is the page title of the selected page.
But the displayed headline should also consider the selected language.

Change-Id: Ie8b3b81139b9618ac5d2331dc86be5e5cad613d5
Resolves: #39106
Releases: 6.1
Reviewed-on: https://review.typo3.org/13598
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Pascal Dürsteler
Tested-by: Pascal Dürsteler
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
parent efa41f58
......@@ -372,6 +372,30 @@ class PageLayoutController {
return $content;
}
/**
*
* @return string $title
*/
protected function getLocalizedPageTitle() {
if ($this->current_sys_language > 0) {
$overlayRecord = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow(
'title',
'pages_language_overlay',
'pid = ' . intval($this->id) .
' AND sys_language_uid = ' . intval($this->current_sys_language) .
\TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('pages_language_overlay') .
\TYPO3\CMS\Backend\Utility\BackendUtility::versioningPlaceholderClause('pages_language_overlay'),
'',
'',
'',
'sys_language_uid'
);
return $overlayRecord['title'];
} else {
return $this->pageinfo['title'];
}
}
/**
* Main function.
* Creates some general objects and calls other functions for the main rendering of module content.
......@@ -501,7 +525,7 @@ class PageLayoutController {
// Removing duplicates, if any
$this->colPosList = implode(',', array_unique(\TYPO3\CMS\Core\Utility\GeneralUtility::intExplode(',', $this->colPosList)));
// Page title
$body = $this->doc->header($this->pageinfo['title']);
$body = $this->doc->header($this->getLocalizedPageTitle());
$body .= $this->getHeaderFlashMessagesForCurrentPid();
// Render the primary module content:
if ($this->MOD_SETTINGS['function'] == 0) {
......@@ -1099,4 +1123,4 @@ class PageLayoutController {
}
?>
\ No newline at end of file
?>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment