Index: branches/unlabeled/unlabeled-1.25.2/core/kernel/utility/temp_handler.php =================================================================== diff -u -r5862 -r5868 --- branches/unlabeled/unlabeled-1.25.2/core/kernel/utility/temp_handler.php (.../temp_handler.php) (revision 5862) +++ branches/unlabeled/unlabeled-1.25.2/core/kernel/utility/temp_handler.php (.../temp_handler.php) (revision 5868) @@ -143,6 +143,35 @@ $this->SetTables($tables); } + /** + * Searches through TempHandler tables info for required prefix + * + * @param string $prefix + * @param Array $master + * @return mixed + */ + function SearchTable($prefix, $master = null) + { + if (is_null($master)) { + $master = $this->Tables; + } + + if ($master['Prefix'] == $prefix) { + return $master; + } + + if (isset($master['SubTables'])) { + foreach ($master['SubTables'] as $sub_table) { + $found = $this->SearchTable($prefix, $sub_table); + if ($found !== false) { + return $found; + } + } + } + + return false; + } + function AddTables($prefix, &$tables) { if (!$this->Application->prefixRegistred($prefix)) { @@ -429,7 +458,6 @@ $live_foreign_key = $this->Conn->GetCol($query); if (isset($temp_id)) { - // if id < 0, then it is 0 by now => substitute it (in progress, by Alex) $query = 'SELECT '.$parent_key_field.' FROM '.$this->GetTempName($master['TableName']).' WHERE '.$master['IdField'].' IN ('.join(',', $temp_id).')'; $temp_foreign_key = $this->Conn->GetCol($query);