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.76.2.47 -r1.76.2.48 --- openacs-4/packages/xotcl-core/tcl/cr-procs.tcl 23 Mar 2021 14:44:39 -0000 1.76.2.47 +++ openacs-4/packages/xotcl-core/tcl/cr-procs.tcl 6 Apr 2021 09:31:32 -0000 1.76.2.48 @@ -484,6 +484,16 @@ ::xo::db::CrItem::slot::name { lappend atts i.[$slot column_name] } + ::xo::db::Object::slot::context_id { + # In case we fetch the item by revision, we would get the + # item_id as contex_id and the resulting object would result + # having object_id = context_id. Make sure the context_id is + # always fetched from the item. + lappend atts { + (select context_id from acs_objects + where object_id = i.item_id) as context_id + } + } ::xo::db::Object::slot::* { lappend atts o.[$slot column_name] }