xowiki::fix_all_package_ids (private)
xowiki::fix_all_package_ids
Defined in packages/xowiki/tcl/xowiki-utility-procs.tcl
Earlier versions of OpenACS did not have the package_id set correctly in acs_objects; this proc updates the package_ids of all items and revisions in acs_objects
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: set folder_ids [list] set package_ids [list] foreach package_id [::xowiki::Package instances] { ns_log notice "checking package_id $package_id" set folder_id [::xo::dc list get_folder_id "select f.folder_id from cr_items c, cr_folders f where c.name = 'xowiki: :package_id' and c.item_id = f.folder_id"] if {$folder_id ne ""} { ::xo::dc dml update_package_id {update acs_objects set package_id = :package_id where object_id in (select item_id as object_id from cr_items where parent_id = :folder_id) and package_id is NULL} ::xo::dc dml update_package_id {update acs_objects set package_id = :package_id where object_id in (select r.revision_id as object_id from cr_revisions r, cr_items i where i.item_id = r.item_id and i.parent_id = :folder_id) and package_id is NULL} } }XQL Not present: Generic, PostgreSQL, Oracle