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 -r1.17 -r1.18 --- openacs-4/packages/xotcl-core/tcl/cr-procs.tcl 17 Mar 2008 00:28:58 -0000 1.17 +++ openacs-4/packages/xotcl-core/tcl/cr-procs.tcl 4 Apr 2008 09:34:18 -0000 1.18 @@ -183,7 +183,7 @@ CrClass set common_query_atts { object_type - creation_user creation_date creation_user + creation_user creation_date publish_status last_modified } if {[apm_version_names_compare [ad_acs_version] 5.2] > -1} { @@ -462,6 +462,7 @@ switch -glob -- $v { publish_status {set fq i.$v} creation_date {set fq o.$v} + creation_user {set fq o.$v} package_id {set fq o.$v} default {set fq n.$v} } @@ -492,6 +493,11 @@ and i.item_id = n.item_id \ and o.object_id = $revision_id" } else { + # We fetch the creation_user and the modifying_user by returning the + # creation_user of the automatic view as modifying_user. In case of + # troubles, comment next line out. + lappend atts "n.creation_user as modifying_user" + $object db_1row [my qn fetch_from_view_item_id] "\ select [join $atts ,], i.parent_id \ from [my set table_name]i n, cr_items i, acs_objects o \ @@ -906,10 +912,19 @@ @param modifying_user @param live_p make this revision the live revision } { - my instvar creation_user + #my instvar creation_user set __atts [list creation_user] set __vars $__atts + # The modifying_user is not maintained by the CR (bug?) + # xotcl-core handles this by having the modifying user as + # creation_user of the revision. + # + # Caveat: the creation_user fetched is different if we fetch via + # item_id (the creation_user is the creator of the item) or if we + # fetch via revision_id (the creation_user is the creator of the + # revision) + set creation_user [expr {[info exists modifying_user] ? $modifying_user : [my current_user_id]}]