Index: openacs-4/packages/dotlrn/tcl/community-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/community-procs.tcl,v diff -u -r1.214 -r1.215 --- openacs-4/packages/dotlrn/tcl/community-procs.tcl 14 Nov 2017 15:46:45 -0000 1.214 +++ openacs-4/packages/dotlrn/tcl/community-procs.tcl 14 Nov 2017 16:12:38 -0000 1.215 @@ -1146,12 +1146,7 @@ community by checking that it's not the same as an existing (possible) sibling's name. } { - if {$parent_community_id ne ""} { - set valid_p [ad_decode [db_string collision_check_with_parent {}] 0 1 0] - } else { - # LARS 2003-10-21: Should this check only against communities with null parent_id? - set valid_p [ad_decode [db_string collision_check_simple {}] 0 1 0] - } + set valid_p [expr {![db_0or1row collision_check {}]}] if {$complain_if_invalid_p && !$valid_p} { ns_log notice "The name '$community_key' is already in use either by an active or archived group. \n Please go back and select a different name." Index: openacs-4/packages/dotlrn/tcl/community-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/community-procs.xql,v diff -u -r1.92 -r1.93 --- openacs-4/packages/dotlrn/tcl/community-procs.xql 14 Nov 2017 15:46:45 -0000 1.92 +++ openacs-4/packages/dotlrn/tcl/community-procs.xql 14 Nov 2017 16:12:38 -0000 1.93 @@ -52,23 +52,15 @@ - + - select count(*) - from dotlrn_communities_all - where :parent_community_id in (select dc.parent_community_id - from dotlrn_communities_all dc - where dc.community_key = :community_key) + select 1 from dotlrn_communities_all + where (:parent_community_id is null or parent_community_id = :parent_community_id) + and community_key = :community_key + limit 1 - - - - select count(*) from dotlrn_communities_all where community_key = :community_key - - - select node_id