[BUGFIX] Database query error for non-workspaces tables 58/29658/2
authorOliver Hader <oliver@typo3.org>
Fri, 25 Apr 2014 13:36:41 +0000 (15:36 +0200)
committerOliver Hader <oliver.hader@typo3.org>
Fri, 25 Apr 2014 15:17:51 +0000 (17:17 +0200)
In frontend rendering mode PageRepository::versionOL() is called
frequently to overlay workspace data. A further method call then
creates a query with required t3ver_* fields. This query fails
if a table is not considered to support workspaces/versioning at
all. This behaviour is regression that has been introduced with
issue #30604 during TYPO3 4.7 development.

Resolves: #58180
Releases: 6.2, 6.1, 6.0
Change-Id: I81d24ea16116563f4f0d75fafd06496a9c4e993d
Reviewed-on: https://review.typo3.org/29658
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
typo3/sysext/frontend/Classes/Page/PageRepository.php

index 99cdd7d..94d4245 100644 (file)
@@ -1150,7 +1150,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'])) {
                        // Have to hardcode it for "pages" table since TCA is not loaded at this moment!
                        // Setting up enableFields for version record:
                        if ($table == 'pages') {