Index: openacs-4/packages/xotcl-core/tcl/cr-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/cr-procs.tcl,v diff -u -N -r1.38 -r1.39 --- openacs-4/packages/xotcl-core/tcl/cr-procs.tcl 30 Nov 2009 10:20:53 -0000 1.38 +++ openacs-4/packages/xotcl-core/tcl/cr-procs.tcl 15 Jun 2010 17:00:37 -0000 1.39 @@ -608,11 +608,10 @@ } lappend cond "coalesce(ci.live_revision,ci.latest_revision) = bt.revision_id" if {$parent_id ne ""} { - set parent_clause "ci.parent_id = $parent_id" - if {$with_children} { - lappend cond "($parent_clause or ci.parent_id in (select item_id from cr_items where parent_id = $parent_id))" + if {$with_children} { + lappend cond "ci.parent_id in (select $parent_id from dual union select item_id from cr_items where parent_id = $parent_id)" } else { - lappend cond $parent_clause + lappend cond "ci.parent_id = $parent_id" } }