Index: openacs-4/packages/acs-subsite/www/admin/group-types/one-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/group-types/one-oracle.xql,v
diff -u -r1.4 -r1.4.2.1
--- openacs-4/packages/acs-subsite/www/admin/group-types/one-oracle.xql 22 Nov 2017 14:57:42 -0000 1.4
+++ openacs-4/packages/acs-subsite/www/admin/group-types/one-oracle.xql 7 Jan 2020 16:54:23 -0000 1.4.2.1
@@ -24,23 +24,4 @@
-
-
-
-
- select a.attribute_id, a.pretty_name,
- a.ancestor_type, t.pretty_name as ancestor_pretty_name
- from acs_object_type_attributes a,
- (select t.object_type, t.pretty_name, level as type_level
- from acs_object_types t
- start with t.object_type='group'
- connect by prior t.object_type = t.supertype) t
- where a.object_type = :group_type
- and t.object_type = a.ancestor_type
- order by type_level
-
-
-
-
-
Index: openacs-4/packages/acs-subsite/www/admin/group-types/one-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/group-types/one-postgresql.xql,v
diff -u -r1.4 -r1.4.2.1
--- openacs-4/packages/acs-subsite/www/admin/group-types/one-postgresql.xql 7 Aug 2017 23:47:58 -0000 1.4
+++ openacs-4/packages/acs-subsite/www/admin/group-types/one-postgresql.xql 7 Jan 2020 16:54:23 -0000 1.4.2.1
@@ -20,24 +20,4 @@
-
-
-
-
- select a.attribute_id, a.pretty_name,
- a.ancestor_type, t.pretty_name as ancestor_pretty_name
- from acs_object_type_attributes a,
- (select t2.object_type, t2.pretty_name,
- tree_level(t2.tree_sortkey) - tree_level(t1.tree_sortkey) + 1 as type_level
- from acs_object_types t1, acs_object_types t2
- where t1.object_type = 'group'
- and t2.tree_sortkey between t1.tree_sortkey and tree_right(t1.tree_sortkey)) t
- where a.object_type = :group_type
- and t.object_type = a.ancestor_type
- order by type_level
-
-
-
-
-
Index: openacs-4/packages/acs-subsite/www/admin/group-types/one.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/group-types/one.tcl,v
diff -u -r1.9 -r1.9.2.1
--- openacs-4/packages/acs-subsite/www/admin/group-types/one.tcl 21 Jan 2018 00:35:29 -0000 1.9
+++ openacs-4/packages/acs-subsite/www/admin/group-types/one.tcl 7 Jan 2020 16:54:23 -0000 1.9.2.1
@@ -47,7 +47,29 @@
db_multirow groups groups_select {}
# Select out all the attributes for groups of this type
-db_multirow -extend {one_attribute_url} attributes attributes_select {} {
+db_multirow -extend {one_attribute_url} attributes attributes_select {
+ with recursive group_hierarchy as (
+ select object_type, pretty_name, 1 as type_level
+ from acs_object_types
+ where object_type = 'group'
+
+ union all
+
+ select t.object_type, t.pretty_name, h.type_level + 1 as type_level
+ from acs_object_types t,
+ group_hierarchy h
+ where t.supertype = h.object_type
+ )
+ select a.attribute_id,
+ a.pretty_name,
+ a.ancestor_type,
+ t.pretty_name as ancestor_pretty_name
+ from acs_object_type_attributes a,
+ group_hierarchy t
+ where a.object_type = :group_type
+ and t.object_type = a.ancestor_type
+ order by type_level
+} {
set one_attribute_url [export_vars -base "../attributes/one" {attribute_id return_url}]
}