Index: branches/5.1.x/core/kernel/utility/temp_handler.php =================================================================== diff -u -N -r13161 -r13162 --- branches/5.1.x/core/kernel/utility/temp_handler.php (.../temp_handler.php) (revision 13161) +++ branches/5.1.x/core/kernel/utility/temp_handler.php (.../temp_handler.php) (revision 13162) @@ -1,6 +1,6 @@ Application->StoreVar($ses_var_name, serialize($changes)); } - function UpdateForeignKeys($master, $live_id, $temp_id) { + function UpdateForeignKeys($master, $live_id, $temp_id) + { $this->UpdateChangeLogForeignKeys($master, $live_id, $temp_id); + foreach ($master['SubTables'] as $sub_table) { $foreign_key_field = is_array($sub_table['ForeignKey']) ? getArrayValue($sub_table, 'ForeignKey', $master['Prefix']) : $sub_table['ForeignKey']; - if (!$foreign_key_field) return; + if (!$foreign_key_field) { + continue; + } + list ($live_foreign_key, $temp_foreign_key) = $this->GetForeignKeys($master, $sub_table, $live_id, $temp_id); //Update ForeignKey in sub TEMP table