Project

General

Profile

Bug #21261 » 20091013_RFC_12220.diff

Administrator Admin, 2009-10-13 12:13

View differences:

t3lib/class.t3lib_loaddbgroup.php (working copy)
$sorting_field = 'sorting_foreign';
if ($this->MM_isMultiTableRelationship) {
$additionalWhere .= ' AND ( tablenames="'.$this->currentTable.'"';
$additionalWhere .= ' AND ( tablenames=\'' . $this->currentTable . '\'';
if ($this->currentTable == $this->MM_isMultiTableRelationship) { // be backwards compatible! When allowing more than one table after having previously allowed only one table, this case applies.
$additionalWhere .= ' OR tablenames=""';
$additionalWhere .= ' OR tablenames=\'\'';
}
$additionalWhere .= ' ) ';
}
......
$additionalWhere_tablenames = '';
if ($this->MM_is_foreign && $prep) {
$additionalWhere_tablenames = ' AND tablenames="'.$this->currentTable.'"';
$additionalWhere_tablenames = ' AND tablenames=\'' . $this->currentTable . '\'';
}
$additionalWhere = '';
......
$whereClause = $uidLocal_field.'='.$uid.' AND '.$uidForeign_field.'='.$val['id'].
($this->MM_hasUidField ? ' AND uid='.intval($oldMMs_inclUid[$oldMMs_index][2]) : ''); // In principle, selecting on the UID is all we need to do if a uid field is available since that is unique! But as long as it "doesn't hurt" we just add it to the where clause. It should all match up.
if ($tablename) {
$whereClause .= ' AND tablenames="'.$tablename.'"';
$whereClause .= ' AND tablenames=\'' . $tablename . '\'';
}
$GLOBALS['TYPO3_DB']->exec_UPDATEquery($MM_tableName, $whereClause.$additionalWhere, array($sorting_field => $c));
......
$elDelete = $oldMMs_inclUid[$oldMM_key];
} else {
if(is_array($mmItem)) {
$removeClauses[] = 'tablenames="'.$mmItem[0].'" AND '.$uidForeign_field.'='.$mmItem[1];
$removeClauses[] = 'tablenames=\'' . $mmItem[0] . '\' AND ' . $uidForeign_field . '=' . $mmItem[1];
} else {
$removeClauses[] = $uidForeign_field.'='.$mmItem;
}
......
$additionalWhere_tablenames = '';
if ($this->MM_is_foreign && $prep) {
$additionalWhere_tablenames = ' AND tablenames="'.$this->currentTable.'"';
$additionalWhere_tablenames = ' AND tablenames=\'' . $this->currentTable . '\'';
}
$additionalWhere = '';
(1-1/2)