Index: openacs-4/packages/file-storage/sql/oracle/file-storage-package-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/sql/oracle/file-storage-package-create.sql,v
diff -u -N -r1.4.2.5 -r1.4.2.6
--- openacs-4/packages/file-storage/sql/oracle/file-storage-package-create.sql	15 Nov 2003 18:17:12 -0000	1.4.2.5
+++ openacs-4/packages/file-storage/sql/oracle/file-storage-package-create.sql	15 Nov 2003 18:47:24 -0000	1.4.2.6
@@ -37,7 +37,7 @@
         -- Wrapper for content_item.new
         --
         item_id in cr_items.item_id%TYPE default null,
-        title in cr_items.name%TYPE,
+        name in cr_items.name%TYPE,
         folder_id in cr_items.parent_id%TYPE,
         creation_user in acs_objects.creation_user%TYPE,
         creation_ip in acs_objects.creation_ip%TYPE,
@@ -58,7 +58,7 @@
         -- Wrapper to content_item__rename
         --
         file_id in cr_items.item_id%TYPE,
-        title in cr_items.name%TYPE
+        name in cr_items.name%TYPE
     );
 
     function copy_file(
@@ -275,7 +275,7 @@
         -- Wrapper for content_item.new
         --
         item_id in cr_items.item_id%TYPE default null,
-        title in cr_items.name%TYPE,
+        name in cr_items.name%TYPE,
         folder_id in cr_items.parent_id%TYPE,
         creation_user in acs_objects.creation_user%TYPE,
         creation_ip in acs_objects.creation_ip%TYPE,
@@ -288,7 +288,7 @@
         then
             v_item_id := content_item.new(
                 item_id => new_file.item_id,
-                name => new_file.title,
+                name => new_file.name,
                 parent_id => new_file.folder_id,
                 creation_user => new_file.creation_user,
                 context_id => new_file.folder_id,
@@ -298,7 +298,7 @@
             );
         else
             v_item_id := content_item.new(
-                name => new_file.title,
+                name => new_file.name,
                 parent_id => new_file.folder_id,
                 creation_user => new_file.creation_user,
                 context_id => new_file.folder_id,
@@ -332,13 +332,13 @@
         -- Wrapper to content_item__rename
         --
         file_id in cr_items.item_id%TYPE,
-        title in cr_items.name%TYPE
+        name in cr_items.name%TYPE
     )
     is
     begin
         content_item.rename(
             item_id => file_storage.rename_file.file_id,
-            name => file_storage.rename_file.title
+            name => file_storage.rename_file.name
         );
     end rename_file;
 
@@ -352,7 +352,7 @@
         creation_ip in acs_objects.creation_ip%TYPE
     ) return cr_revisions.revision_id%TYPE
     is
-        v_title                 cr_items.name%TYPE;
+        v_name                 cr_items.name%TYPE;
         v_live_revision         cr_items.live_revision%TYPE;
         v_filename              cr_revisions.title%TYPE;
         v_description           cr_revisions.description%TYPE;
@@ -369,7 +369,7 @@
         select i.name, i.live_revision, r.title, r.description,
                r.mime_type, r.content, r.filename, r.content_length,
                decode(i.storage_type,'lob','t','f')
-        into v_title, v_live_revision, v_filename, v_description,
+        into v_name, v_live_revision, v_filename, v_description,
              v_mime_type, v_lob, v_file_path, v_content_length,
              v_indb_p
         from cr_items i, cr_revisions r
@@ -380,7 +380,7 @@
         -- We should probably use the copy functions of CR
         -- when we optimize this function
         v_new_file_id := file_storage.new_file(
-            title => v_title,
+            name => v_name,
             folder_id => file_storage.copy_file.target_folder_id,
             creation_user => file_storage.copy_file.creation_user,
             creation_ip => file_storage.copy_file.creation_ip,
@@ -464,6 +464,7 @@
         where cr_items.item_id = file_storage.new_version.item_id;
 
         acs_object.update_last_modified(v_folder_id,new_version.creation_user,new_version.creation_ip);
+	acs_object.update_last_modified(new_version.item_id,new_version.creation_user,new_version.creation_ip);
 
         return v_revision_id;
 
@@ -473,13 +474,10 @@
 
     function get_title(
         --
-        -- Unfortunately, title in the file-storage context refers
-        -- to the name attribute in cr_items, not the title attribute in
-        -- cr_revisions
         item_id in cr_items.item_id%TYPE
     ) return varchar
     is
-        v_title                 cr_items.name%TYPE;
+        v_title                 cr_revisions.title%TYPE;
         v_content_type          cr_items.content_type%TYPE;
     begin
         select content_type
@@ -499,9 +497,10 @@
                 from cr_symlinks
                 where symlink_id = get_title.item_id;
             else
-                select name into v_title
-                from cr_items
-                where item_id = get_title.item_id;
+                select title into v_title
+                from cr_revisions, cr_items
+                where item_id = get_title.item_id
+	        and   live_revision = revision_id;
             end if;
         end if;
 
