From: Oliver Hader Date: Wed, 2 Jul 2014 09:28:32 +0000 (+0200) Subject: [BUGFIX] Workspace not always applied in RelationHandler queries X-Git-Tag: 6.2.4~62 X-Git-Url: http://git.typo3.org/Packages/TYPO3.CMS.git/commitdiff_plain/f1b50201441dc8cd8cbc8f6a6c9b50ac8edf6bee [BUGFIX] Workspace not always applied in RelationHandler queries The possibly submitted value to RelationHandler::setWorkspaceId() is not used for SQL queries to read IRRE foreign field relations. In that case the current $BE_USER->workspace value is used which might be different to the requested workspace id. Resolves: #60053 Releases: 6.2, 6.3 Change-Id: Ib01e4df798ff2e1fcc8c29997f6effb814dc4344 Reviewed-on: https://review.typo3.org/31286 Reviewed-by: Oliver Hader Tested-by: Oliver Hader --- diff --git a/typo3/sysext/core/Classes/Database/RelationHandler.php b/typo3/sysext/core/Classes/Database/RelationHandler.php index dbc08469090a..736f113f3da6 100644 --- a/typo3/sysext/core/Classes/Database/RelationHandler.php +++ b/typo3/sysext/core/Classes/Database/RelationHandler.php @@ -818,7 +818,7 @@ class RelationHandler { } // Select children from the live(!) workspace only if (BackendUtility::isTableWorkspaceEnabled($foreign_table)) { - $workspaceList = '0,' . (int)$GLOBALS['BE_USER']->workspace; + $workspaceList = '0,' . $this->getWorkspaceId(); $whereClause .= ' AND ' . $foreign_table . '.t3ver_wsid IN (' . $workspaceList . ') AND ' . $foreign_table . '.pid<>-1'; } // Get the correct sorting field