Index: branches/5.0.x/core/kernel/utility/temp_handler.php =================================================================== diff -u -N -r12783 -r12868 --- branches/5.0.x/core/kernel/utility/temp_handler.php (.../temp_handler.php) (revision 12783) +++ branches/5.0.x/core/kernel/utility/temp_handler.php (.../temp_handler.php) (revision 12868) @@ -1,6 +1,6 @@ setEventParam('foreign_key', $foreign_key); } - foreach($ids as $id) - { + $set_temp_id = ($name == 'OnAfterCopyToLive') && (!is_array($add_params) || !array_key_exists('temp_id', $add_params)); + + foreach($ids as $index => $id) { $event->setEventParam('id', $id); + + if ($set_temp_id) { + $event->setEventParam('temp_id', $index); + } + if (is_array($add_params)) { foreach ($add_params as $name => $val) { $event->setEventParam($name, $val); } } + $this->Application->HandleEvent($event); } + return $event->status == erSUCCESS; }