Issue Bug Closed

#57752Relation-Bug for non-Workspace Records: purgeVersionedIds has fixed t3ver_oid,t3ver_state,t3ver_wsid

David Frerich 04/08/14, 16:26 updated 02/26/16, 16:29

Description

exec_SELECTquery
caller TYPO3\CMS\Core\Database\DatabaseConnection::exec_SELECTquery
ERROR Unknown column ‘t3ver_oid’ in ‘field list’

lastBuiltQuery SELECT uid,t3ver_oid,t3ver_state FROM fe_users WHERE pid=-1 AND t3ver_oid IN (1) AND t3ver_wsid<>0 ORDER BY t3ver_state DESC
debug_backtrace TYPO3\CMS\Backend\Controller\EditDocumentController->processData#48 // TYPO3\CMS\Core\DataHandling\DataHandler->process_datamap#516 // TYPO3\CMS\Core\DataHandling\DataHandler->fillInFieldArray#1150 // TYPO3\CMS\Core\DataHandling\DataHandler->checkValue#1404 // TYPO3\CMS\Core\DataHandling\DataHandler->checkValue_SW#1545 // TYPO3\CMS\Core\DataHandling\DataHandler->checkValue_group_select#1598 // TYPO3\CMS\Core\DataHandling\DataHandler->checkValue_group_select_processDBdata#1844 // TYPO3\CMS\Core\Database\RelationHandler->writeMM#2606 // TYPO3\CMS\Core\Database\RelationHandler->updateRefIndex#708 // TYPO3\CMS\Core\Database\ReferenceIndex->updateRefIndexTable#1142 // TYPO3\CMS\Core\Database\ReferenceIndex->generateRefIndexData#130 // TYPO3\CMS\Core\Database\ReferenceIndex->getRelations#188 // TYPO3\CMS\Core\Database\ReferenceIndex->getRelations_procDB#410 // TYPO3\CMS\Core\Database\RelationHandler->start#619 // TYPO3\CMS\Core\Database\RelationHandler->purgeItemArray#354 // call_user_func#1172 // TYPO3\CMS\Core\Database\RelationHandler->purgeVersionedIds# // TYPO3\CMS\Core\Database\DatabaseConnection->exec_SELECTgetRows#1204 // TYPO3\CMS\Core\Database\DatabaseConnection->debug#369

t3ver_oid, t3ver_state and t3ver_wsid are fixed in the purgeVersionedIds method.
So no relations with non-workspace records, such as fe_users work with categories

/**
 * Purges ids that are versioned.
 *
 * param string $tableName
 * param array $ids
 * @return array
*/
protected function purgeVersionedIds($tableName, array $ids) {
$ids = $this->getDatabaseConnection()->cleanIntArray($ids);
$ids = array_combine($ids, $ids);
    $versions = $this->getDatabaseConnection()->exec_SELECTgetRows(
‘uid,t3ver_oid,t3ver_state’,
$tableName,
‘pid=-1 AND t3ver_oid IN (’ . implode(‘,’, $ids) . ‘) AND t3ver_wsid<>0’,
‘’,
‘t3ver_state DESC’
);
    if (!empty($versions)) {
foreach ($versions as $version) {
$versionId = $version[‘uid’];
if (isset($ids[$versionId])) {
unset($ids[$versionId]);
}
}
}
    return array_values($ids);
}

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.