Bug #58180

Database query error for non-workspaces tables

Added by rengaw83 about 7 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Workspaces
Target version:
-
Start date:
2014-04-25
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.1
PHP Version:
Tags:
Complexity:
easy
Is Regression:
Yes
Sprint Focus:

Description

When i have to check if a record exists and is accessible, i do that with the checkRecord method in the page repository:

/* @var $sysPage \TYPO3\CMS\Frontend\Page\PageRepository */
$sysPage = $GLOBALS['TSFE']->sys_page;
$sysPage->checkRecord('tx_extension_table', $uid, 1);

It the Table is not localizable or verionable and you are in a versioning preview, the following error occurs:
caller     TYPO3\CMS\Core\Database\DatabaseConnection::exec_SELECTquery
ERROR     Unknown column 't3ver_oid' in 'where clause'
lastBuiltQuery     SELECT uid,pid,tstamp,crdate,hidden,starttime,endtime,sorting,fe_group,title,title_lang_ol,image,shortcut,shortcut_target,deleted,single_pid,parent_category,description FROM tt_news_cat WHERE pid=-1 AND t3ver_oid=1 AND t3ver_wsid=1 AND tt_news_cat.deleted=0 LIMIT 1
debug_backtrace     require(index_t3.php),index.php#37 // require(typo3\sysext\cms\tslib\index_ts.php),index_t3.php#41 // TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->INTincScript#204 // TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->recursivelyReplaceIntPlaceholdersInContent#3425 // TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->INTincScript_process#3451 // TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer->USER#3503 // TYPO3\CMS\Frontend\ContentObject\UserContentObject->render#905 // TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer->callUserFunction#55 // call_user_func_array#6439 // tx_ttnews->main_news# // tx_ttnews->initCategoryVars#188 // tx_ttnews_helpers->checkRecords#3733 // TYPO3\CMS\Frontend\Page\PageRepository->checkRecord#104 // TYPO3\CMS\Frontend\Page\PageRepository->versionOL#713 // TYPO3\CMS\Frontend\Page\PageRepository->getWorkspaceVersionOfRecord#1039 // TYPO3\CMS\Core\Database\DatabaseConnection->exec_SELECTgetSingleRow#1164 // TYPO3\CMS\Core\Database\DatabaseConnection->exec_SELECTquery#400 // TYPO3\CMS\Core\Database\DatabaseConnection->debug#297

The Problem here ist, that the method versionOL is called, without a check for versionable table.

A good example ist the 'tt_news_cat'' table of the tt_news extension.
See #57187

The same problem orrurs on the cObjGetSingle call for the rendering:

exec_SELECTquery
caller     TYPO3\CMS\Core\Database\DatabaseConnection::exec_SELECTquery
ERROR     Unknown column 't3ver_oid' in 'where clause'
lastBuiltQuery     SELECT uid,pid,tstamp,crdate,hidden,starttime,endtime,sorting,fe_group,title,title_lang_ol,image,shortcut,shortcut_target,deleted,single_pid,parent_category,description FROM tt_news_cat WHERE pid=-1 AND t3ver_oid=7 AND t3ver_wsid=1 AND tt_news_cat.deleted=0 LIMIT 1
debug_backtrace     require(index_t3.php),index.php#37 // require(typo3\sysext\cms\tslib\index_ts.php),index_t3.php#41 // TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->INTincScript#204 // TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->recursivelyReplaceIntPlaceholdersInContent#3425 // TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->INTincScript_process#3451 // TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer->USER#3503 // TYPO3\CMS\Frontend\ContentObject\UserContentObject->render#905 // TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer->callUserFunction#55 // call_user_func_array#6439 // tx_ttnews->main_news# // tx_ttnews->displayList#206 // tx_ttnews->getListContent#726 // tx_ttnews->getItemMarkerArray#1036 // tx_ttnews->getGenericMarkers#1761 // TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer->cObjGetSingle#1918 // TYPO3\CMS\Frontend\ContentObject\RecordsContentObject->render#739 // TYPO3\CMS\Frontend\Page\PageRepository->versionOL#82 // TYPO3\CMS\Frontend\Page\PageRepository->getWorkspaceVersionOfRecord#1039 // TYPO3\CMS\Core\Database\DatabaseConnection->exec_SELECTgetSingleRow#1164 // TYPO3\CMS\Core\Database\DatabaseConnection->exec_SELECTquery#400 // TYPO3\CMS\Core\Database\DatabaseConnection->debug#297

The Problem here ist the same of the checkRecord call.

I am not shure, but i think a check for versioning in the ctrl section of the TCA should solve the problem


Related issues

Related to TYPO3 Core - Task #30604: Remove unsupported functions and options related to versioning/workspacesClosedBenni Mack2011-10-06

Actions
#1

Updated by Oliver Hader about 7 years ago

I guess the behaviour is the same down to TYPO3 4.5, right?

#2

Updated by Oliver Hader about 7 years ago

  • Status changed from New to Accepted
  • Complexity set to easy
  • Is Regression changed from No to Yes

Regression since TYPO3 4.7, has been introduced in #30604 in method getWorkspaceVersionOfRecord

#3

Updated by Oliver Hader about 7 years ago

  • Subject changed from versionOL for non-Workspace Records in PageRepository and RecordsContentObject to Database query error for non-workspaces tables
#4

Updated by Gerrit Code Review about 7 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/29657

#5

Updated by Gerrit Code Review about 7 years ago

Patch set 1 for branch TYPO3_6-1 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/29658

#6

Updated by Gerrit Code Review about 7 years ago

Patch set 1 for branch TYPO3_6-0 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/29660

#7

Updated by Oliver Hader about 7 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#8

Updated by Benni Mack over 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF