Index: openacs-4/packages/acs-tcl/tcl/object-type-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/object-type-procs-oracle.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-tcl/tcl/object-type-procs-oracle.xql 3 Apr 2005 09:33:55 -0000 1.2 +++ openacs-4/packages/acs-tcl/tcl/object-type-procs-oracle.xql 11 Apr 2005 22:18:48 -0000 1.3 @@ -34,6 +34,7 @@ from acs_object_types start with object_type = :subtype connect by prior supertype = object_type + where object_type != :substype order by level desc Index: openacs-4/packages/acs-tcl/tcl/object-type-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/object-type-procs-postgresql.xql,v diff -u -r1.6 -r1.7 --- openacs-4/packages/acs-tcl/tcl/object-type-procs-postgresql.xql 3 Apr 2005 09:33:55 -0000 1.6 +++ openacs-4/packages/acs-tcl/tcl/object-type-procs-postgresql.xql 11 Apr 2005 22:18:48 -0000 1.7 @@ -31,13 +31,13 @@ - + select o2.object_type from acs_object_types o1, acs_object_types o2 where o1.object_type = :subtype - and o2.tree_sortkey <= o1.tree_sortkey + and o2.tree_sortkey < o1.tree_sortkey and o1.tree_sortkey between o2.tree_sortkey and tree_right(o2.tree_sortkey) order by tree_level(o2.tree_sortkey) desc Index: openacs-4/packages/acs-tcl/tcl/object-type-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/object-type-procs.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/acs-tcl/tcl/object-type-procs.tcl 3 Apr 2005 09:33:55 -0000 1.5 +++ openacs-4/packages/acs-tcl/tcl/object-type-procs.tcl 11 Apr 2005 22:18:48 -0000 1.6 @@ -114,21 +114,30 @@ ad_proc -private acs_object_type::supertype { {-supertype:required} {-subtype:required} - {-no_cache:boolean} } { Returns true if subtype is equal to, or a subtype of, supertype. @author Lee Denison (lee@thaum.net) } { - if {$no_cache_p} { - set supertypes [db_list supertypes {}] + set supertypes [object_type::supertypes] + append supertypes $subtype - return [expr {[lsearch $supertypes $supertype] >= 0}] + return [expr {[lsearch $supertypes $supertype] >= 0}] +} + +ad_proc -private acs_object_type::supertypes { + {-subtype:required} + {-no_cache:boolean} +} { + Returns a list of the supertypes of subtypes. + + @author Lee Denison (lee@thaum.net) +} { + if {$no_cache_p} { + return [db_list supertypes {}] } else { - return [util_memoize [list acs_object_type::supertype \ - -supertype $supertype \ + return [util_memoize [list acs_object_type::supertypes \ -subtype $subtype \ -no_cache]] } } -