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}] }