Index: openacs-4/packages/xotcl-core/xotcl-core.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/xotcl-core.info,v diff -u -r1.106.2.34 -r1.106.2.35 --- openacs-4/packages/xotcl-core/xotcl-core.info 20 Dec 2021 17:42:31 -0000 1.106.2.34 +++ openacs-4/packages/xotcl-core/xotcl-core.info 8 Jan 2022 15:18:10 -0000 1.106.2.35 @@ -10,7 +10,7 @@ t xotcl - + Gustaf Neumann XOTcl library functionality (e.g. thread handling, online documentation, Generic Form and List Classes) 2021-09-16 @@ -42,7 +42,7 @@ BSD-Style 2 - + 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.76.2.53 -r1.76.2.54 --- openacs-4/packages/xotcl-core/tcl/cr-procs.tcl 30 Dec 2021 15:26:37 -0000 1.76.2.53 +++ openacs-4/packages/xotcl-core/tcl/cr-procs.tcl 8 Jan 2022 15:18:10 -0000 1.76.2.54 @@ -89,15 +89,33 @@ @return fully qualified object containing the attributes of the CrItem } { set object ::[expr {$revision_id ? $revision_id : $item_id}] + if {$object eq "::0"} { + set msg "get_instance_from_db must be called with either item_id or revision_id different from 0" + ad_log error $msg + error $msg + } if {![::nsf::is object $object]} { set object_type [:get_object_type -item_id $item_id -revision_id $revision_id] set class [::xo::db::Class object_type_to_class $object_type] set object [$class get_instance_from_db -item_id $item_id -revision_id $revision_id -initialize $initialize] } return $object } - #{4.544836 microseconds per iteration} - #{1.310991 microseconds per iteration} + + CrClass ad_proc ensure_item_ids_instantiated { + {-initialize:boolean true} + {-item_ids:required} + } { + + Make sure, the objects all of the provided items_ids are + instantiated initialized (i.e. the same-named objects do exist as + executable commands in the current thread). + + } { + foreach item_id $item_ids { + :get_instance_from_db -item_id $item_id -initialize $initialize + } + } CrClass ad_proc get_parent_id { -item_id:required