Index: openacs-4/packages/bug-tracker/sql/oracle/bug-tracker-create-packages.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/sql/oracle/bug-tracker-create-packages.sql,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/bug-tracker/sql/oracle/bug-tracker-create-packages.sql	14 Apr 2003 13:34:03 -0000	1.2
+++ openacs-4/packages/bug-tracker/sql/oracle/bug-tracker-create-packages.sql	28 Aug 2003 09:45:29 -0000	1.3
@@ -56,6 +56,10 @@
         bug_id          in integer
     );
 
+    function name (
+        bug_id        in integer
+    ) return varchar2;
+
 end bt_bug;
 /
 show errors
@@ -148,9 +152,15 @@
             name => 'bug_tracker_' || bt_project.new.package_id,
             label => v_instance_name,
             description => null,
-            parent_id => v_root_folder_id
+            parent_id => v_root_folder_id,
+            context_id => bt_project.new.package_id,
+            creation_user => v_creation_user,
+            creation_ip => v_creation_ip
         );
 
+        -- Set package_id column. Oddly enoguh, there is no API to set it
+        update cr_folders set package_id = bt_project.new.package_id where folder_id = v_folder_id;
+
         -- register our content type
         content_folder.register_content_type (
             folder_id =>        v_folder_id,
@@ -212,6 +222,9 @@
              bt_patch.delete(rec.patch_id);
         end loop;
 
+        -- delete the content folder
+        content_folder.delete(v_folder_id);
+
         -- delete the projects keywords
         bt_project.keywords_delete(
             project_id => project_id,
@@ -224,10 +237,6 @@
         delete from bt_user_prefs where project_id = bt_project.delete.project_id;      
 
         delete from bt_projects where project_id = bt_project.delete.project_id;   
-
-        -- delete the content folder
-        content_folder.delete(v_folder_id);
-
     end delete;
 
     procedure keywords_delete (
@@ -415,7 +424,7 @@
         from workflow_cases
         where object_id = bt_bug.delete.bug_id;
 
-        foo := workflow_case.delete(v_case_id);
+        foo := workflow_case_pkg.delete(v_case_id);
         
         -- Every bug may have notifications attached to it
         -- and there is one column in the notificaitons datamodel that doesn't
@@ -430,6 +439,20 @@
         return;
     end delete;
 
+    function name (
+        bug_id         in integer
+    ) return varchar2
+    is
+        v_name          bt_bugs.summary%TYPE;
+    begin
+        select summary
+        into   v_name
+        from   bt_bugs
+        where  bug_id = name.bug_id;
+
+        return v_name;
+    end name;
+
 end bt_bug;
 /
 show errors
