Index: openacs-4/packages/ecommerce/www/admin/cat/subsubcategory-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/cat/subsubcategory-add-2.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/cat/subsubcategory-add-2.tcl 20 Apr 2001 20:51:13 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/cat/subsubcategory-add-2.tcl 18 Jul 2001 02:52:45 -0000 1.2 @@ -54,10 +54,15 @@ # now make sure there's no subsubcategory in this subcategory with that sort key already +### gilbertw - added do the calculation outside of the db. PostgreSQL encloses +# the bind variables in ' ' +# where sort_key = (:prev_sort_key + :next_sort_key)/2 +set sort_key [expr ($prev_sort_key + $next_sort_key)/2] + set n_conflicts [db_string get_n_conflicts "select count(*) from ec_subsubcategories where subcategory_id=:subcategory_id -and sort_key = (:prev_sort_key + :next_sort_key)/2"] +and sort_key = :sort_key"] if { $n_conflicts > 0 } { ad_return_complaint 1 "