Index: typo3/sysext/cms/tslib/class.tslib_content.php =================================================================== --- typo3/sysext/cms/tslib/class.tslib_content.php (revision 9189) +++ typo3/sysext/cms/tslib/class.tslib_content.php (working copy) @@ -1020,7 +1020,7 @@ $this->doConvertToUserIntObject = FALSE; $content = $this->USER($conf, 'INT'); } else { - $content .= $tempContent; + $content = $tempContent; } break; } @@ -1575,8 +1575,21 @@ } $conf['table'] = trim($this->stdWrap($conf['table'], $conf['table.'])); - if ($conf['table'] == 'pages' || substr($conf['table'], 0, 3) == 'tt_' || substr($conf['table'], 0, 3) == 'fe_' || substr($conf['table'], 0, 3) == 'tx_' || substr($conf['table'], 0, 4) == 'ttx_' || substr($conf['table'], 0, 5) == 'user_' || substr($conf['table'], 0, 7) == 'static_') { + $virtualRows = array(); + if (isset($conf['data'])) { + switch ($conf['data']) { + case 'USER': + $virtualRows = $this->USER($conf['data.']); + break; + case 'USER_INT': + $virtualRows = $this->USER($conf['data.'], 'INT'); + break; + } + } + + if ($virtualRows || $conf['table'] == 'pages' || substr($conf['table'], 0, 3) == 'tt_' || substr($conf['table'], 0, 3) == 'fe_' || substr($conf['table'], 0, 3) == 'tx_' || substr($conf['table'], 0, 4) == 'ttx_' || substr($conf['table'], 0, 5) == 'user_' || substr($conf['table'], 0, 7) == 'static_') { + $renderObjName = $conf['renderObj'] ? $conf['renderObj'] : '<' . $conf['table']; $renderObjKey = $conf['renderObj'] ? 'renderObj' : ''; $renderObjConf = $conf['renderObj.']; @@ -1588,24 +1601,35 @@ $again = FALSE; do { - $res = $this->exec_getQuery($conf['table'], $conf['select.']); - if ($error = $GLOBALS['TYPO3_DB']->sql_error()) { + $error = FALSE; + if (!$virtualRows) { + $res = $this->exec_getQuery($conf['table'], $conf['select.']); + $error = $GLOBALS['TYPO3_DB']->sql_error(); + } + if ($error) { $GLOBALS['TT']->setTSlogMessage($error, 3); } else { - $this->currentRecordTotal = $GLOBALS['TYPO3_DB']->sql_num_rows($res); - $GLOBALS['TT']->setTSlogMessage('NUMROWS: ' . $GLOBALS['TYPO3_DB']->sql_num_rows($res)); + $this->currentRecordTotal = $virtualRows ? count($virtualRows) : $GLOBALS['TYPO3_DB']->sql_num_rows($res); + $GLOBALS['TT']->setTSlogMessage('NUMROWS: ' . $this->currentRecordTotal); $cObj = t3lib_div::makeInstance('tslib_cObj'); $cObj->setParent($this->data, $this->currentRecord); $this->currentRecordNumber = 0; $cobjValue = ''; - while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { + if ($virtualRows) { + $virtualKeys = array_keys($virtualRows); + $row = $virtualRows[$virtualKeys[0]]; + } else { + $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res); + } + while ($row) { + if (!$virtualRows) { + // Versioning preview: + $GLOBALS['TSFE']->sys_page->versionOL($conf['table'], $row, TRUE); - // Versioning preview: - $GLOBALS['TSFE']->sys_page->versionOL($conf['table'], $row, TRUE); - - // Language overlay: - if (is_array($row) && $GLOBALS['TSFE']->sys_language_contentOL) { - $row = $GLOBALS['TSFE']->sys_page->getRecordOverlay($conf['table'], $row, $GLOBALS['TSFE']->sys_language_content, $GLOBALS['TSFE']->sys_language_contentOL); + // Language overlay: + if (is_array($row) && $GLOBALS['TSFE']->sys_language_contentOL) { + $row = $GLOBALS['TSFE']->sys_page->getRecordOverlay($conf['table'], $row, $GLOBALS['TSFE']->sys_language_content, $GLOBALS['TSFE']->sys_language_contentOL); + } } if (is_array($row)) { // Might be unset in the sys_language_contentOL @@ -1619,8 +1643,16 @@ $cobjValue .= $tmpValue; } } + + if ($virtualRows) { + $row = $this->currentRecordNumber < $this->currentRecordTotal ? $virtualRows[$virtualKeys[$this->currentRecordNumber]] : FALSE; + } else { + $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res); + } } - $GLOBALS['TYPO3_DB']->sql_free_result($res); + if (!$virtualRows) { + $GLOBALS['TYPO3_DB']->sql_free_result($res); + } } if ($slideCollectReverse) { $theValue = $cobjValue . $theValue;