Index: openacs-4/packages/xowiki/tcl/form-field-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/form-field-procs.tcl,v diff -u -r1.106 -r1.107 --- openacs-4/packages/xowiki/tcl/form-field-procs.tcl 30 Sep 2008 08:48:09 -0000 1.106 +++ openacs-4/packages/xowiki/tcl/form-field-procs.tcl 1 Oct 2008 22:14:28 -0000 1.107 @@ -866,6 +866,7 @@ -parameter { plugins folder_id + script_dir width height {wiki false} @@ -1020,7 +1021,7 @@ -default [::xo::parameter get_from_package_key \ -package_key "acs-templating" -parameter "XinhaDefaultPlugins"]] } - my set options [my get_attributes editor plugins width height folder_id javascript] + my set options [my get_attributes editor plugins width height folder_id script_dir javascript] # for the time being, we can't set the defaults via parameter, # but only manually, since the editor is used as a mixin, the parameter # would have precedence over the defaults of subclasses Index: openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl,v diff -u -r1.105 -r1.106 --- openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl 29 Sep 2008 01:38:19 -0000 1.105 +++ openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl 1 Oct 2008 22:14:28 -0000 1.106 @@ -98,10 +98,14 @@ if {[$f istype ::xowiki::formfield::richtext] && [my folderspec] ne ""} { - # insert the folder id into the spec for the - # oacsfs plugin to access the correct filestore instance - foreach {key value} [my folderspec] break - $f $key $value + # Insert the folder_id and the script_dir into the spec for + # the oacsfs plugin to access the correct filestore instance + # and to find the script directory + foreach {key value} [my folderspec] { + $f $key $value + } + # We have to reinitialize for exporting these values asWidgetSpec + $f initialize } set __spec ${__field}:[$f asWidgetSpec] Index: openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl,v diff -u -r1.181 -r1.182 --- openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 29 Sep 2008 10:23:52 -0000 1.181 +++ openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 1 Oct 2008 22:14:28 -0000 1.182 @@ -313,12 +313,24 @@ lappend parse_level [info level] set action_vars [expr {$new ? "{edit-new 1} object_type return_url" : "{m edit} return_url"}] #my log "--formclass=[$object_type getFormClass -data [self]] ot=$object_type" + + # Use always the name of the frist xowiki instance (required for sub-packages, + # which might not have the script dir) + set first_instance_id [::xo::parameter get_package_id_from_package_key -package_key xowiki] + if {$first_instance_id ne ""} { + ::xowiki::Package require $first_instance_id + set folder_spec [list script_dir [$first_instance_id package_url]] + } + + if {$fs_folder_id ne ""} {lappend folder_spec folder_id $fs_folder_id} + [$object_type getFormClass -data [self]] create ::xowiki::f1 -volatile \ -action [export_vars -base [$package_id url] $action_vars] \ -data [self] \ - -folderspec [expr {$fs_folder_id ne "" ?"folder_id $fs_folder_id":""}] \ + -folderspec $folder_spec \ -submit_link $submit_link \ -autoname $autoname + if {[info exists return_url]} { ::xowiki::f1 generate -export [list [list return_url $return_url]] } else {