Index: openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-functions-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/sql/postgresql/Attic/project-manager-functions-create.sql,v
diff -u -r1.4 -r1.5
--- openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-functions-create.sql	30 Jul 2003 23:36:07 -0000	1.4
+++ openacs-4/contrib/packages/project-manager/sql/postgresql/project-manager-functions-create.sql	6 Aug 2003 20:22:18 -0000	1.5
@@ -403,11 +403,12 @@
 returns varchar as '
 declare
     p_pm_task_id         alias for $1;
-    v_pm_task_name       pm_task.title%TYPE;
+    v_pm_task_name       pm_tasks.title%TYPE;
 begin
-        select title into v_pm_project_name
-                from pm_tasks_revisionsx
-                where item_id = p_pm_task_id limit 1;
+        select t.title into v_pm_project_name
+                from pm_tasks_revisionsx t, cr_items i
+                where t.item_id = p_pm_task_id and 
+                i.live_revision = t.item_id;
     return v_pm_task_name;
 end;
 ' language 'plpgsql';
