--- class.t3lib_befunc.php.old 2009-08-14 05:53:39.000000000 +0200 +++ class.t3lib_befunc.php 2009-08-14 09:45:16.000000000 +0200 @@ -3439,15 +3439,32 @@ if ($TCA[$table] && $TCA[$table]['ctrl']['versioningWS']) { - // Select all versions of record: - $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery( - $fields, - $table, - '((pid=-1 AND t3ver_oid='.intval($uid).($workspace!=0?' AND t3ver_wsid='.intval($workspace):'').') OR uid='.intval($uid).')'. - ($includeDeletedRecords ? '' : t3lib_BEfunc::deleteClause($table)), - '', - 't3ver_id DESC' - ); + if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['selectVersionsQuery'][$table])) { + $classRef = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['selectVersionsQuery'][$table]; + $params = Array( + 'table' => $table, + 'uid' => $uid, + 'fields' => $fields, + 'workspace' => $workspace, + 'includeDeletedRecords' => $includeDeletedRecords + ); + $sql = t3lib_div::callUserFunction($classRef,$params,$this); + } else { + + // Build query to select all versions of record: + $sql = $GLOBALS['TYPO3_DB']->SELECTquery( + $fields, + $table, + '((pid=-1 AND t3ver_oid='.intval($uid).($workspace!=0?' AND t3ver_wsid='.intval($workspace):'').') OR uid='.intval($uid).')'. + ($includeDeletedRecords ? '' : t3lib_BEfunc::deleteClause($table)), + '', + 't3ver_id DESC' + ); + + } + + // Execute query + $res = $GLOBALS['TYPO3_DB']->sql_query($sql); // Add rows to output array: $realPid = 0;