Index: openacs-4/packages/xowiki/tcl/includelet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/includelet-procs.tcl,v diff -u -r1.191.2.18 -r1.191.2.19 --- openacs-4/packages/xowiki/tcl/includelet-procs.tcl 1 Sep 2014 11:25:59 -0000 1.191.2.18 +++ openacs-4/packages/xowiki/tcl/includelet-procs.tcl 4 Sep 2014 12:27:08 -0000 1.191.2.19 @@ -3524,6 +3524,7 @@ set parent_id [$__including_page parent_id] } if {![info exists button_objs]} { + set button_objs {} foreach b $buttons { if {[llength $b]>1} { lassign $b button id @@ -3532,10 +3533,18 @@ } set form [::xo::db::CrClass get_instance_from_db -item_id $id] # - # "Package require" is just a part of "Package initialize" creating - # the package object if needed + # "Package require" is just a part of "Package initialize" + # creating the package object if needed.... # set form_package_id [$form package_id] + if {$form_package_id eq ""} { + # + # When the package_id is empty, the page might be from a + # site-wide page. Resolve the form page to the local context + # + $form set_resolve_context -package_id $package_id -parent_id $parent_id + set form_package_id $package_id + } ::xowiki::Package require $form_package_id set obj [form-menu-button-$button new -volatile -package_id $package_id \ -base [$form pretty_link] \ Index: openacs-4/packages/xowiki/tcl/package-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/package-procs.tcl,v diff -u -r1.279.2.12 -r1.279.2.13 --- openacs-4/packages/xowiki/tcl/package-procs.tcl 2 Aug 2014 15:18:33 -0000 1.279.2.12 +++ openacs-4/packages/xowiki/tcl/package-procs.tcl 4 Sep 2014 12:27:08 -0000 1.279.2.13 @@ -1660,7 +1660,12 @@ #my ds "lookup from base objects $name => $item_id" if {$item_id} { set page [::xo::db::CrClass get_instance_from_db -item_id $item_id] - ::xo::Package require [$page package_id] + set package_id [$page package_id] + if {$package_id ne ""} { + #$form set_resolve_context -package_id $package_id -parent_id $parent_id + ::xo::Package require [$package_id] + } + return $page } return ""