Index: openacs-4/packages/dotlrn/www/admin/community-type.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/community-type.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/dotlrn/www/admin/community-type.tcl 27 Jan 2018 17:58:19 -0000 1.4 +++ openacs-4/packages/dotlrn/www/admin/community-type.tcl 13 Jun 2018 16:37:27 -0000 1.5 @@ -16,13 +16,12 @@ } -validate { } -errors { } - -if { [info exists community_type] } { - set edit_p [dotlrn_community::type_exists $community_type] -} else { - set edit_p 0 -} +set edit_p [expr {[info exists community_type] && + [db_0or1row type_exists { + select 1 from dotlrn_community_types + where community_type = :community_type}]}] + if { $edit_p } { set title "[_ dotlrn.edit_community_type]" @@ -61,7 +60,7 @@ -pretty_name $pretty_name } else { # Update type - db_dml set_community_type {} + db_dml set_community_type {} } } -after_submit { ad_returnredirect "community-types"