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.203 -r1.204 --- openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 11 Dec 2008 00:37:10 -0000 1.203 +++ openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 12 Dec 2008 13:46:25 -0000 1.204 @@ -1667,7 +1667,13 @@ return [list] } - Page instproc create-new {{-view_method edit}} { + Page instproc create-or-use args { + my msg "" + # can be overloaded + eval my create-new $args + } + + Page instproc create-new {{-view_method edit} {-name ""}} { my instvar package_id set instance_attributes [my default_instance_attributes] set original_package_id $package_id @@ -1681,15 +1687,17 @@ if {[catch { ::xowiki::Package initialize \ -url $package_instance -user_id [::xo::cc user_id] \ - -actual_query ""} errorMsg]} { + -actual_query "" + } errorMsg]} { ns_log error "$errorMsg\n$::errorInfo" return [$original_package_id error_msg \ "Page '[my name]' invalid provided package instance=$package_instance

$errorMsg

"] } my parent_id [$package_id folder_id] } set f [FormPage new -destroy_on_cleanup \ - -name "" \ + -name $name \ + -text "" \ -package_id $package_id \ -parent_id [my parent_id] \ -nls_language [my nls_language] \ @@ -1701,6 +1709,9 @@ $f set state [my set state] } + # Make sure to load the instance attributes + $f array set __ia [$f instance_attributes] + # Call the application specific initialization, when a FormPage is # initially created. This is used to control the life-cycle of # FormPages.