Index: openacs-4/packages/file-storage/sql/oracle/upgrade/upgrade-5.1.0d1-5.1.0d2.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/sql/oracle/upgrade/upgrade-5.1.0d1-5.1.0d2.sql,v
diff -u -r1.3 -r1.3.2.1
--- openacs-4/packages/file-storage/sql/oracle/upgrade/upgrade-5.1.0d1-5.1.0d2.sql	13 Jan 2005 13:58:10 -0000	1.3
+++ openacs-4/packages/file-storage/sql/oracle/upgrade/upgrade-5.1.0d1-5.1.0d2.sql	19 Mar 2006 22:26:40 -0000	1.3.2.1
@@ -462,9 +462,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 crr.title into v_title
+		from cr_revisions crr, cr_items cri
+		where crr.revision_id=cri.live_revision
+		and cri.item_id=get_title.item_id;
             end if;
         end if;
 
