Index: openacs-4/packages/xowiki/tcl/includelet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/includelet-procs.tcl,v diff -u -r1.30 -r1.31 --- openacs-4/packages/xowiki/tcl/includelet-procs.tcl 25 Apr 2008 17:23:35 -0000 1.30 +++ openacs-4/packages/xowiki/tcl/includelet-procs.tcl 26 Apr 2008 16:13:05 -0000 1.31 @@ -515,7 +515,13 @@ lappend trees [list [lindex [category_tree::get_id $tree_name] 0] $name] } } - #my msg "[llength $trees] == 0 && $tree_name" + + #my msg "nr trees = [llength $trees] && $tree_name" + if {[llength $trees] == 0} { + # safety net + return "" + } + foreach tree $trees { foreach {tree_id my_tree_name ...} $tree {break} if {!$no_tree_name} { @@ -539,11 +545,11 @@ set category($cid) $c lappend categories $cid } - + set sql "category_object_map c, cr_items ci, cr_revisions r, xowiki_page p \ where c.object_id = ci.item_id and ci.parent_id = $folder_id \ and ci.content_type not in ('::xowiki::PageTemplate') \ - and category_id in ([join $categories ,]) \ + and c.category_id in ([join $categories ,]) \ and r.revision_id = ci.live_revision \ and p.page_id = r.revision_id \ and ci.publish_status <> 'production'" Index: openacs-4/packages/xowiki/tcl/xowiki-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-procs.tcl,v diff -u -r1.239 -r1.240 --- openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 25 Apr 2008 17:46:03 -0000 1.239 +++ openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 26 Apr 2008 16:13:05 -0000 1.240 @@ -287,7 +287,7 @@ my log "...importing category tree $name" category_tree::import -name $name -description $description \ -locale $locale -categories $categories - set tree_id [category_tree::get_id $tree_name] + set tree_id [category_tree::get_id $name] } # # build reverse category_map