Index: openacs-4/packages/acs-content-repository/sql/oracle/content-item.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/sql/oracle/content-item.sql,v
diff -u -r1.29 -r1.29.2.1
--- openacs-4/packages/acs-content-repository/sql/oracle/content-item.sql	12 Mar 2005 19:22:15 -0000	1.29
+++ openacs-4/packages/acs-content-repository/sql/oracle/content-item.sql	29 Dec 2005 01:24:01 -0000	1.29.2.1
@@ -26,7 +26,7 @@
 
 begin
 
-  if item_id is NULL then
+  if item_id is NULL or item_id in (-4,-100,-200) then
 
     v_folder_id := c_root_folder_id;
 
@@ -37,7 +37,7 @@
     from
       cr_items
     where 
-      parent_id = 0
+      parent_id = -4
     connect by
       prior parent_id = item_id
     start with
@@ -115,7 +115,7 @@
     v_parent_id := parent_id;
   end if;
 
-  if package_id is null and parent_id ^= 0 then
+  if package_id is null and parent_id ^= -4 then
     v_package_id := acs_object.package_id(content_item.get_root_folder(v_parent_id));
   else
     v_package_id := package_id;
@@ -128,10 +128,10 @@
     v_context_id := context_id;
   end if;
 
-  if v_parent_id = 0 or 
+  if v_parent_id = -4 or 
     content_folder.is_folder(v_parent_id) = 't' then
 
-    if v_parent_id ^= 0 and 
+    if v_parent_id ^= -4 and 
       content_folder.is_registered(
         v_parent_id, content_item.new.content_type, 'f') = 'f' then
 
@@ -141,7 +141,7 @@
 
     end if;
 
-  elsif v_parent_id ^= 0 then
+  elsif v_parent_id ^= -4 then
 
     begin
 
@@ -204,7 +204,7 @@
 
   -- if the parent is not a folder, insert into cr_child_rels
   -- We checked above before creating the object that it is a valid rel
-  if v_parent_id ^= 0 and
+  if v_parent_id ^= -4 and
     content_folder.is_folder(v_parent_id) = 'f' then
 
     v_rel_id := acs_object.new(
@@ -773,7 +773,7 @@
 
   v_count integer;
   v_name varchar2(400); 
-  v_parent_id integer := 0;
+  v_parent_id integer := -4;
   v_tree_level integer;
 
   v_resolved_root_id integer;
@@ -792,7 +792,7 @@
     order by
       tree_level desc;
 
-  v_rel_parent_id integer := 0;
+  v_rel_parent_id integer := -4;
   v_rel_tree_level integer := 0;
 
   v_path varchar2(4000) := '';
