Index: openacs-4/packages/expenses/tcl/expenses-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/expenses/tcl/expenses-procs.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/expenses/tcl/expenses-procs.tcl 24 Jun 2005 13:05:39 -0000 1.5 +++ openacs-4/packages/expenses/tcl/expenses-procs.tcl 16 Jul 2005 13:02:36 -0000 1.6 @@ -62,16 +62,20 @@ set package_id [db_string "getpackageid" "select community_id from expenses where exp_id = :id"] # get the tree id of the terms category - set tree_id [db_string "gettreeid" "select tree_id from category_tree_translations where name = 'Terms'"] - set terms [list] - set categories [category::get_mapped_categories $package_id] - foreach category_id $categories { - if { [category::get_tree $category_id] == $tree_id } { - lappend terms "[category::get_name $category_id]" + if { [db_0or1row "get_treeid" "select tree_id from category_tree_translations where name = 'Terms'"] } { + + set terms [list] + set categories [category::get_mapped_categories $package_id] + foreach category_id $categories { + if { [category::get_tree $category_id] == $tree_id } { + lappend terms "[category::get_name $category_id]" + } } + return [join $terms ", "] + } else { + return "" } - return [join $terms ", "] }