Commit 48fd54c4 authored by Sebastian Michaelsen's avatar Sebastian Michaelsen Committed by Christian Kuhn
Browse files

[TASK] Don't try to create language switch for non-persisted records

The language switch is never rendered for non-persisted records,
so the method to create it should not be called in this sitation.

Resolves: #92971
Releases: master, 10.4
Change-Id: If6d85a7bbf44a841f08d0331da3e5e0943232953
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/66962

Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent d82bc6c5
......@@ -1016,11 +1016,15 @@ class EditDocumentController
}
// Setting up the buttons and markers for doc header
$this->getButtons($request);
$this->languageSwitch(
(string)($this->firstEl['table'] ?? ''),
(int)($this->firstEl['uid'] ?? 0),
isset($this->firstEl['pid']) ? (int)$this->firstEl['pid'] : null
);
// Create language switch options if the record is already persisted
if ($this->isSavedRecord) {
$this->languageSwitch(
(string)($this->firstEl['table'] ?? ''),
(int)($this->firstEl['uid'] ?? 0),
isset($this->firstEl['pid']) ? (int)$this->firstEl['pid'] : null
);
}
$this->moduleTemplate->setContent($body);
}
......
Markdown is supported
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