Index: openacs-4/packages/acs-kernel/sql/oracle/upgrade/upgrade--5.9.1d15-5.9.1d16.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/oracle/upgrade/upgrade--5.9.1d15-5.9.1d16.sql,v
diff -u -N -r1.2.2.1 -r1.2.2.2
--- openacs-4/packages/acs-kernel/sql/oracle/upgrade/upgrade--5.9.1d15-5.9.1d16.sql	12 Feb 2022 20:11:02 -0000	1.2.2.1
+++ openacs-4/packages/acs-kernel/sql/oracle/upgrade/upgrade--5.9.1d15-5.9.1d16.sql	13 Feb 2022 15:45:06 -0000	1.2.2.2
@@ -9,6 +9,7 @@
   v_object_id_one acs_rels.object_id_one%TYPE;
   v_object_id_two acs_rels.object_id_two%TYPE;
   v_rel_type      acs_rels.rel_type%TYPE;
+  v_composable_p  acs_rel_types.composable_p%TYPE;
   v_error varchar2(4000);
 begin
   
@@ -19,7 +20,7 @@
   end if;
 
   select object_id_one, object_id_two, r.rel_type, composable_p
-  into v_object_id_one, v_object_id_two, v_rel_type
+  into v_object_id_one, v_object_id_two, v_rel_type, v_composable_p
   from acs_rels r
   join acs_rel_types t on (r.rel_type = t.rel_type)
   where rel_id = :new.rel_id;
@@ -59,6 +60,7 @@
 /
 show errors
 
+
 create or replace trigger composition_rels_in_tr
 after insert on composition_rels
 for each row
@@ -133,7 +135,7 @@
 
     -- Add rows for my composable elements
 
-    for members in (select distinct member_id, rel_type
+    for members in (select distinct m.member_id, m.rel_type
                     from group_approved_member_map m
                      join acs_rel_types t on (m.rel_type = t.rel_type)
                     where group_id = v_object_id_two
@@ -152,7 +154,7 @@
       rel_type, ancestor_rel_type)
     select distinct
      map.group_id, element_id, rel_id, container_id,
-     rel_type, ancestor_rel_type
+     m.rel_type, ancestor_rel_type
     from group_element_map m
     join acs_rel_types t on (m.rel_type = t.rel_type)
     where group_id = v_object_id_two
