Project

General

Profile

Bug #16723 ยป 1.patch

Administrator Admin, 2006-11-17 18:09

View differences:

class.tx_realurl.php 2011-02-24 13:05:58.000000000 +0100
return $returnId;
} else { // If no cached entry, look it up directly in the table:
$fieldList[] = $cfg['id_field'];
// store the result in a unique name provides problems with the form table.field
$fieldList[] = $cfg['id_field'] . ' AS temp';
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(implode(',', $fieldList), $cfg['table'],
$cfg['alias_field'] . '=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($value, $cfg['table']) .
' ' . $cfg['addWhereClause']);
$row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
$GLOBALS['TYPO3_DB']->sql_free_result($res);
if ($row) {
$returnId = $row[$cfg['id_field']];
$returnId = $row['temp'];
// If localization is enabled, check if this record is a localized version and if so, find uid of the original version.
if ($langEnabled && $row[$cfg['languageField']] > 0) {
......
} else { // If no cached entry, look up alias directly in the table (and possibly store cache value)
$fieldList[] = $cfg['alias_field'];
// store the result in a unique name provides problems with the form table.field
$fieldList[] = $cfg['alias_field'] . ' AS temp';
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(implode(',', $fieldList), $cfg['table'],
$cfg['id_field'] . '=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($value, $cfg['table']) .
' ' . $cfg['addWhereClause']);
......
$mLength = $cfg['maxLength'] ? $cfg['maxLength'] : $this->maxLookUpLgd;
if ($cfg['useUniqueCache']) { // If cache is to be used, store the alias in the cache:
$aliasBaseValue = $row[$cfg['alias_field']];
$aliasBaseValue = $row['temp'];
return $this->lookUp_newAlias($cfg, substr($aliasBaseValue, 0, $mLength), $value, $lang);
} else { // If no cache for alias, then just return whatever value is appropriate:
if (strlen($row[$cfg['alias_field']]) <= $mLength) {
return $row[$cfg['alias_field']];
return $row['temp'];
} else {
return $value;
}
    (1-1/1)