Index: openacs-4/packages/xowiki/tcl/xowiki-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/Attic/xowiki-portlet-procs.tcl,v diff -u -r1.56 -r1.57 --- openacs-4/packages/xowiki/tcl/xowiki-portlet-procs.tcl 25 May 2007 10:13:30 -0000 1.56 +++ openacs-4/packages/xowiki/tcl/xowiki-portlet-procs.tcl 11 Jun 2007 12:21:17 -0000 1.57 @@ -1684,15 +1684,17 @@ # there must be a better way to handle temporaray tables safely.... catch {db_dml [my qn drop_temp_table] {drop table XOWIKI_TEMP_TABLE }} - db_dml [my qn get_n_most_revent_contributions] { - create temporary table XOWIKI_TEMP_TABLE as - select i.item_id, revision_id, creation_user - from cr_revisions cr, cr_items i, acs_objects o - where cr.item_id = i.item_id and i.parent_id = :folder_id - and o.object_id = revision_id - order by revision_id desc limit :max_activities - } + set sql "create global temporary table XOWIKI_TEMP_TABLE as " + append sql [::xo::db::sql select \ + -vars "i.item_id, revision_id, creation_user" \ + -from "cr_revisions cr, cr_items i, acs_objects o" \ + -where "cr.item_id = i.item_id and i.parent_id = $folder_id \ + and o.object_id = revision_id" \ + -orderby "revision_id desc" \ + -limit $max_activities] + db_dml [my qn get_n_most_recent_contributions] $sql + set total 0 db_foreach [my qn get_activities] { select count(revision_id),item_id, creation_user