Index: openacs-4/packages/xowiki/tcl/weblog-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/weblog-procs.tcl,v diff -u -r1.12 -r1.13 --- openacs-4/packages/xowiki/tcl/weblog-procs.tcl 25 May 2007 09:29:59 -0000 1.12 +++ openacs-4/packages/xowiki/tcl/weblog-procs.tcl 25 May 2007 11:52:02 -0000 1.13 @@ -37,7 +37,8 @@ set extra_where_clause "" if {$date ne ""} { - set date_clause "and date_trunc('day',p.publish_date) = '$date'" + #set date_clause "and date_trunc('day',p.publish_date) = '$date'" + set date_clause "and [::xo::db::sql date_trunc_expression day p.publish_date $date]" set filter_msg "Filtered by date $date" set query_parm "&date=$date" } else { @@ -102,7 +103,7 @@ set sql \ [list -folder_id $folder_id \ -select_attributes $attributes \ - -orderby "p.publish_date desc" \ + -orderby "publish_date desc" \ -from_clause "$extra_from_clause , $base_table p left outer join syndication s on s.object_id = p.revision_id" \ -where_clause "ci.item_id not in ([my exclude_item_ids]) \ and ci.name != '::$folder_id' and ci.name not like '%weblog%' $date_clause \ Index: openacs-4/packages/xowiki/www/admin/test.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/admin/Attic/test.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/xowiki/www/admin/test.tcl 25 May 2007 10:13:31 -0000 1.4 +++ openacs-4/packages/xowiki/www/admin/test.tcl 25 May 2007 11:52:02 -0000 1.5 @@ -86,7 +86,9 @@ ? {site_node::exists_p -url /$instance_name} 0 \ "the test instance does not exist" -set root_id [site_node::get_root_node_id] +#set root_id [site_node::get_root_node_id] +set root_id [db_string "" {select node_id from site_nodes where parent_id is null}] + if {[db_0or1row check_broken_site_nodes { select node_id, name from site_nodes where name = :instance_name and parent_id = :root_id }]} { Index: openacs-4/packages/xowiki/www/portlets/weblog-mini-calendar.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/portlets/Attic/weblog-mini-calendar.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/xowiki/www/portlets/weblog-mini-calendar.tcl 15 Mar 2007 12:10:50 -0000 1.6 +++ openacs-4/packages/xowiki/www/portlets/weblog-mini-calendar.tcl 25 May 2007 11:52:02 -0000 1.7 @@ -57,14 +57,15 @@ multirow append days_of_week [lindex $week_days [expr {($i + $first_day_of_week) % 7}]] } -db_foreach entries_this_month "select count(ci.item_id), date_trunc('day',p.publish_date) as d \ +db_foreach entries_this_month "select count(ci.item_id), + [::xo::db::sql date_trunc day p.publish_date] as d \ from xowiki_pagei p, cr_items ci \ where ci.parent_id = $folder_id \ and ci.item_id = p.item_id and ci.live_revision = p.page_id \ and ci.content_type not in ('::xowiki::PageTemplate') \ and ci.item_id != $including_item_id \ and ci.publish_status <> 'production' \ - and date_trunc('month', p.publish_date) = '$year-$month-01' \ + and [::xo::db::sql date_trunc_expression month p.publish_date $year-$month-01] \ group by d" { set entries([lindex $d 0]) $count }