[BUGFIX] Database query error for non-workspaces tables
[Packages/TYPO3.CMS.git] / typo3 / sysext / frontend / Classes / Page / PageRepository.php
index fd774ec..6c0c62d 100644 (file)
@@ -1287,7 +1287,7 @@ class PageRepository {
         * @todo Define visibility
         */
        public function getWorkspaceVersionOfRecord($workspace, $table, $uid, $fields = '*', $bypassEnableFieldsCheck = FALSE) {
-               if ($workspace !== 0) {
+               if ($workspace !== 0 && !empty($GLOBALS['TCA'][$table]['ctrl']['versioningWS'])) {
                        $workspace = (int)$workspace;
                        $uid = (int)$uid;
                        // Have to hardcode it for "pages" table since TCA is not loaded at this moment!