diff --git a/modules/SecurityGroups/SecurityGroup.php b/modules/SecurityGroups/SecurityGroup.php index 37ce4452728..c9caf9d18a4 100755 --- a/modules/SecurityGroups/SecurityGroup.php +++ b/modules/SecurityGroups/SecurityGroup.php @@ -281,7 +281,11 @@ public static function inherit_creator($focus, $isUpdate) } elseif ($focus->db->dbType == 'mssql') { $query .= ' lower(newid()) '; } - $currentUserId = isset($current_user->id) ? $focus->db->quote($current_user->id) : null; + if (isset($focus->created_by) && $focus->created_by!= '') { + $currentUserId = $focus->db->quote($focus->created_by); + } else { + $currentUserId = isset($current_user->id) ? $focus->db->quote($current_user->id) : null; + } $recordId = $focus->db->quote($focus->id); $query .= ",u.securitygroup_id,'$recordId','$focus->module_dir'," . $focus->db->convert('', 'today') . ',0 '