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 -N -r1.32.2.1 -r1.32.2.2
--- openacs-4/packages/acs-content-repository/sql/oracle/content-item.sql	13 Feb 2022 11:46:26 -0000	1.32.2.1
+++ openacs-4/packages/acs-content-repository/sql/oracle/content-item.sql	21 Feb 2022 18:20:40 -0000	1.32.2.2
@@ -1079,23 +1079,33 @@
 procedure set_live_revision (
   revision_id    in cr_revisions.revision_id%TYPE,
   publish_status in cr_items.publish_status%TYPE default 'ready',
-  publish_date   in cr_revisions.publish_date%TYPE default sysdate
+  publish_date   in cr_revisions.publish_date%TYPE default sysdate,
+  is_latest      in char default 'f'
 ) is
 begin
 
-  update
-    cr_items
-  set
-    live_revision = set_live_revision.revision_id,
-    publish_status = set_live_revision.publish_status
-  where
-    item_id = (select
-                 item_id
-               from
-                 cr_revisions
-               where
-                 revision_id = set_live_revision.revision_id);
+  if set_live_revision.is_latest = 't' then
+    update cr_items
+      set
+            live_revision = set_live_revision.revision_id,
+            publish_status = set_live_revision.publish_status,
+            latest_revision = set_live_revision.revision_id
+      where
+            item_id = (select item_id
+               from   cr_revisions
+               where  revision_id = set_live_revision.revision_id);
+  else
+    update cr_items
+      set
+            live_revision = set_live_revision.revision_id,
+            publish_status = set_live_revision.publish_status
+      where
+            item_id = (select item_id
+               from   cr_revisions
+               where  revision_id = set_live_revision.revision_id);
+  end if;
 
+
   update
     cr_revisions
   set
