diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-80485-MethodParameterOfTSFE-whichWorkspaceToReturnTheWorkspaceTitle.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-80485-MethodParameterOfTSFE-whichWorkspaceToReturnTheWorkspaceTitle.rst new file mode 100644 index 0000000000000000000000000000000000000000..26f2e66457df2205e23cc2fcdd67f5a27e489333 --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-80485-MethodParameterOfTSFE-whichWorkspaceToReturnTheWorkspaceTitle.rst @@ -0,0 +1,39 @@ +.. include:: ../../Includes.txt + +============================================================================================ +Deprecation: #80485 - Method parameter of TSFE->whichWorkspace to return the workspace title +============================================================================================ + +See :issue:`80485` + +Description +=========== + +The method php::`TypoScriptFrontendController->whichWorkspace()` has an optional first parameter +to return the workspace title of the current workspace instead of the current workspace UID. + +This parameter has been marked as deprecated. + + +Impact +====== + +When calling the method above with the method parameter set to "true", a deprecation message is +triggered. + + +Affected Installations +====================== + +Any installation using this PHP method with the parameter set to "true" via a custom extension which +deals with workspaces for frontend output (e.g. for editors to know in which workspace a user is +currently previewing a page). + + +Migration +========= + +If the workspace title is necessary, a separate SQL call should be done right after +`whichWorkspace()` is called in the extensions' PHP code. + +.. index:: Frontend, PHP-API \ No newline at end of file diff --git a/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php b/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php index fcb0ec1c614f825f5b1214b5a479ceddf216df58..3d969597343cd951e583ea8afe62b86b4814fdae 100644 --- a/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php +++ b/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php @@ -4124,7 +4124,7 @@ class TypoScriptFrontendController /** * Returns the name of the workspace * - * @param bool $returnTitle If set, returns title of current workspace being previewed + * @param bool $returnTitle If set, returns title of current workspace being previewed, please be aware that this parameter is deprecated as of TYPO3 v8, and will be removed in TYPO3 v9 * @return string|int|NULL If $returnTitle is set, returns string (title), otherwise workspace integer for which workspace is being preview. NULL if none. */ public function whichWorkspace($returnTitle = false) @@ -4136,6 +4136,7 @@ class TypoScriptFrontendController $ws = $this->getBackendUser()->workspace; } if ($ws && $returnTitle) { + GeneralUtility::deprecationLog('The parameter $returnTitle of $TSFE->whichWorkspace() is marked as deprecated and has no effect anymore. It will be removed in TYPO3 v9.'); if (ExtensionManagementUtility::isLoaded('workspaces')) { $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) ->getQueryBuilderForTable('sys_workspace');