Index: branches/5.3.x/core/kernel/db/cat_event_handler.php =================================================================== diff -u -N -r15483 -r15677 --- branches/5.3.x/core/kernel/db/cat_event_handler.php (.../cat_event_handler.php) (revision 15483) +++ branches/5.3.x/core/kernel/db/cat_event_handler.php (.../cat_event_handler.php) (revision 15677) @@ -1,6 +1,6 @@ getObject(); /* @var $object kDBItem */ - $user_id = $object->GetDBField($id_field); - $options = $object->GetFieldOptions($id_field); - - if ( isset($options['options'][$user_id]) ) { - $object->SetDBField($cached_field, $options['options'][$user_id]); - } - else { - $id_field = $this->Application->getUnitOption('u', 'IDField'); - $table_name = $this->Application->getUnitOption('u', 'TableName'); - - $sql = 'SELECT Username - FROM ' . $table_name . ' - WHERE ' . $id_field . ' = ' . $user_id; - $object->SetDBField($cached_field, $this->Conn->GetOne($sql)); - } + $object->SetDBField($cached_field, $object->GetField($id_field)); } /** @@ -2587,15 +2573,15 @@ switch ( $event->Name ) { case 'OnCreate': $event_suffix = $is_active ? 'ADD' : 'ADD.PENDING'; - $this->Application->EmailEventAdmin($perm_prefix . '.' . $event_suffix); // there are no ADD.PENDING event for admin :( - $this->Application->EmailEventUser($perm_prefix . '.' . $event_suffix, $owner_id); + $this->Application->emailAdmin($perm_prefix . '.' . $event_suffix); // there are no ADD.PENDING event for admin :( + $this->Application->emailUser($perm_prefix . '.' . $event_suffix, $owner_id); break; case 'OnUpdate': $event_suffix = $is_active ? 'MODIFY' : 'MODIFY.PENDING'; $user_id = is_numeric($object->GetDBField('ModifiedById')) ? $object->GetDBField('ModifiedById') : $owner_id; - $this->Application->EmailEventAdmin($perm_prefix . '.' . $event_suffix); // there are no ADD.PENDING event for admin :( - $this->Application->EmailEventUser($perm_prefix . '.' . $event_suffix, $user_id); + $this->Application->emailAdmin($perm_prefix . '.' . $event_suffix); // there are no ADD.PENDING event for admin :( + $this->Application->emailUser($perm_prefix . '.' . $event_suffix, $user_id); break; } }