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.4 -r1.5
--- openacs-4/packages/file-storage/sql/oracle/upgrade/upgrade-5.1.0d1-5.1.0d2.sql	26 May 2005 08:28:45 -0000	1.4
+++ openacs-4/packages/file-storage/sql/oracle/upgrade/upgrade-5.1.0d1-5.1.0d2.sql	8 Aug 2006 21:26:48 -0000	1.5
@@ -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;
 
