Index: openacs-4/packages/xotcl-core/tcl/generic-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/generic-procs.tcl,v diff -u -r1.90 -r1.91 --- openacs-4/packages/xotcl-core/tcl/generic-procs.tcl 5 Sep 2007 23:04:59 -0000 1.90 +++ openacs-4/packages/xotcl-core/tcl/generic-procs.tcl 18 Aug 2008 12:10:52 -0000 1.91 @@ -99,6 +99,7 @@ set old_name [::xo::cc form_parameter __object_name ""] set new_name [$data set name] if {$old_name ne $new_name} { + #my msg "rename from $old_name to $new_name" db_dml [my qn update_rename] "update cr_items set name = :new_name \ where item_id = [$data set item_id]" } @@ -123,26 +124,24 @@ set context [list $edit_form_page_title] } - Form instproc new_request {} { - #my log "--- new_request ---" - my request create + Form instproc set_form_data {} { my instvar data - #my log "--VAR [my var item_id]" foreach var [[$data info class] array names db_slot] { if {[$data exists $var]} { my var $var [list [$data set $var]] } } } + + Form instproc new_request {} { + #my log "--- new_request ---" + my request create + my set_form_data + } Form instproc edit_request {item_id} { - my instvar data #my log "--- edit_request ---" my request write - foreach var [[$data info class] array names db_slot] { - if {[$data exists $var]} { - my var $var [list [$data set $var]] - } - } + my set_form_data } Form instproc on_submit {item_id} { 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.99 -r1.100 --- openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl 5 May 2008 12:29:17 -0000 1.99 +++ openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl 18 Aug 2008 12:10:52 -0000 1.100 @@ -200,11 +200,8 @@ my instvar data set old_name [::xo::cc form_parameter __object_name ""] - if {$name eq $old_name && $name ne ""} { - # do not change names, which are already validated; - # otherwise, autonamed entries might get an unwanted en:prefix - return 1 - } + #my msg "validate: old='$old_name', current='$name'" + # my log "--F validate_name data=[my exists data]" $data instvar package_id if {[$data istype ::xowiki::File] && [$data exists mime_type]} { @@ -225,20 +222,27 @@ return 0 } } else { - if {![regexp {^..:} $name]} { - if {![info exists nls_language]} { - set nls_language [lang::conn::locale] - } - set name [$data complete_name $name $nls_language] - } + set stripped_name $name + regexp {^..:(.*)$} $name _ stripped_name + set new_nls_language [$data form_parameter nls_language {}] + set name [$data complete_name $stripped_name $new_nls_language] } set name [::$package_id normalize_name $name] + #my msg "validate: old='$old_name', new='$name'" + if {$name eq $old_name && $name ne ""} { + # do not change names, which are already validated; + # otherwise, autonamed entries might get an unwanted en:prefix + return 1 + } + # check, if we try to create a new item with an existing name + #my msg "validate: new=[$data form_parameter __new_p 0], eq=[expr {$old_name ne $name}]" if {[$data form_parameter __new_p 0] - || [$data form_parameter __object_name] ne $name + || $old_name ne $name } { set folder_id [$data parent_id] + #my msg "exists in db [::xo::db::CrClass lookup -name $name -parent_id $folder_id]" return [expr {[::xo::db::CrClass lookup -name $name -parent_id $folder_id] == 0}] } return 1 @@ -260,9 +264,19 @@ return $success } +## We could strip the language prefix from the name, since it is essentially +## ignored... but we keep it for informational purposes +# +# WikiForm instproc set_form_data {} { +# next +# #my msg "name in form=[my var name]" +# set name_in_form [my var name] +# if {[regexp {^..:(.*)$} $name_in_form _ stripped_name]} { +# # use stripped "name" in form to avoid possible confusions +# my var name $stripped_name +# } +# } - - WikiForm instproc data_from_form {{-new 0}} { my instvar data if {[$data exists_form_parameter text.format]} { Index: openacs-4/packages/xowiki/tcl/xowiki-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-procs.tcl,v diff -u -r1.264 -r1.265 --- openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 15 Aug 2008 13:20:17 -0000 1.264 +++ openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 18 Aug 2008 12:10:52 -0000 1.265 @@ -2060,6 +2060,8 @@ my unset_temporary_instance_variables my instvar package_id name + #my msg "save_data old='$old_name' current='$name'" + db_transaction { # # if the newly created item was in production mode, but ordinary entries @@ -2076,6 +2078,7 @@ # my log "-- old_name $old_name, name $name" if {$old_name ne $name} { my log "--formpage renaming" + #my msg "do rename from $old_name to $name" db_dml [my qn update_rename] "update cr_items set name = :name \ where item_id = [my item_id]" } Index: openacs-4/packages/xowiki/www/oacs-view.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/Attic/oacs-view.adp,v diff -u -r1.47 -r1.48 --- openacs-4/packages/xowiki/www/oacs-view.adp 28 Feb 2008 09:05:41 -0000 1.47 +++ openacs-4/packages/xowiki/www/oacs-view.adp 18 Aug 2008 12:10:52 -0000 1.48 @@ -1,15 +1,15 @@ - + @title;noquote@ @context;noquote@ property_body property_doc - @header_stuff;noquote@ + - + @header_stuff;noquote@ - + @header_stuff;noquote@ - + @header_stuff;noquote@ - + @header_stuff;noquote@ - + @header_stuff;noquote@ - + @header_stuff;noquote@