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.21 -r1.106.2.22 --- openacs-4/packages/xotcl-core/xotcl-core.info 16 Jul 2020 16:56:44 -0000 1.106.2.21 +++ openacs-4/packages/xotcl-core/xotcl-core.info 27 Jul 2020 17:47:03 -0000 1.106.2.22 @@ -10,7 +10,7 @@ t xotcl - + Gustaf Neumann XOTcl library functionality (e.g. thread handling, online documentation, Generic Form and List Classes) 2017-08-06 @@ -42,7 +42,7 @@ BSD-Style 2 - + Index: openacs-4/packages/xotcl-core/tcl/06-package-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/06-package-procs.tcl,v diff -u -r1.41.2.25 -r1.41.2.26 --- openacs-4/packages/xotcl-core/tcl/06-package-procs.tcl 14 Jul 2020 19:43:09 -0000 1.41.2.25 +++ openacs-4/packages/xotcl-core/tcl/06-package-procs.tcl 27 Jul 2020 17:47:03 -0000 1.41.2.26 @@ -332,9 +332,36 @@ return "" } - - - + PackageMgr instproc fix_site_wide_package_ids {} { + # + # In case, site-wide pages were moved to the global instance, fix + # the package ids. + # + set site_info [:require_site_wide_info] + set package_id [dict get $site_info instance_id] + set item_ids [xo::db::CrClass get_child_item_ids \ + -item_id [dict get $site_info folder_id]] + if {[llength $item_ids] > 0} { + xo::dc transaction { + # + # Fix items + # + xo::dc dml fix_package_ids1 [subst { + update acs_objects set package_id = :package_id + where object_id in ([ns_dbquotelist $item_ids]) + }] + # + # Fix revisions + # + xo::dc dml fix_package_ids2 [subst { + update acs_objects set package_id = :package_id + where object_id in (select revision_id from cr_revisions + where item_id in ([ns_dbquotelist $item_ids])) + }] + } + } + } + PackageMgr ad_instproc initialize { -ad_doc {-parameter ""}