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.211 -r1.212 --- openacs-4/packages/xowiki/tcl/form-field-procs.tcl 30 Mar 2012 09:07:02 -0000 1.211 +++ openacs-4/packages/xowiki/tcl/form-field-procs.tcl 3 May 2012 11:01:25 -0000 1.212 @@ -724,7 +724,7 @@ my set widget_type file(file) next } - file instproc entry_name {value} { + file instproc entry_info {value} { return [list name file:[my name] parent_id [[my object] item_id]] } @@ -781,7 +781,7 @@ [my object] set_property [my name] $value set package_id [[my object] package_id] - array set entry_info [my entry_name $value] + array set entry_info [my entry_info $value] set content_type [my set content-type] if {$content_type eq "application/octetstream" @@ -830,7 +830,7 @@ file instproc pretty_value {v} { if {$v ne ""} { my instvar object - array set "" [my entry_name $v] + array set "" [my entry_info $v] array set "" [$object item_ref -default_lang [[my object] lang] -parent_id $(parent_id) $(name)] #my msg "pretty value name '$(stripped_name)'" set l [::xowiki::Link create new -destroy_on_cleanup \ @@ -845,7 +845,7 @@ file instproc render_input {} { my instvar value set package_id [[my object] package_id] - array set entry_info [my entry_name $value] + array set entry_info [my entry_info $value] set fn [my get_from_value $value name $value] set href [$package_id pretty_link -download 1 -parent_id $entry_info(parent_id) $entry_info(name)] if {![my istype image]} { @@ -899,7 +899,9 @@ my instvar object set package_id [$object package_id] set parent_id [$object parent_id] - array set "" [my entry_name $v] + if {$v eq ""} {return ""} + array set "" [my entry_info $v] + set fn [my get_from_value $v name $v] # # Get the file object of the imported file to obtain is full name and path # @@ -909,7 +911,7 @@ # # Call the archiver to unpack and handle the archive # - set f [::xowiki::ArchiveFile new -file $full_file_name -name $v -parent_id $parent_id] + set f [::xowiki::ArchiveFile new -file $full_file_name -name $fn -parent_id $parent_id] if {[$f unpack]} { # # So, all the hard work is done. We take a hard measure here to @@ -938,7 +940,7 @@ border border-width position top botton left right } image instproc pretty_value {v} { - array set "" [my entry_name $v] + array set "" [my entry_info $v] return [my pretty_image -parent_id $(parent_id) $(name)] } Index: openacs-4/packages/xowiki/tcl/import-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/import-procs.tcl,v diff -u -r1.23 -r1.24 --- openacs-4/packages/xowiki/tcl/import-procs.tcl 10 Apr 2012 11:38:55 -0000 1.23 +++ openacs-4/packages/xowiki/tcl/import-procs.tcl 3 May 2012 11:01:25 -0000 1.24 @@ -381,7 +381,10 @@ ArchiveFile instproc unpack {} { my instvar name file set success 0 + #my log "::xowiki::guesstype '$name' => [::xowiki::guesstype $name]" switch [::xowiki::guesstype $name] { + application/zip - + application/x-zip - application/x-zip-compressed { set zipcmd [::util::which unzip] #my msg "zip = $zipcmd, tempdir = [my set tmpdir]" @@ -401,7 +404,7 @@ } default {my msg "type [::xowiki::guesstype $name] of $name unknown"} } - my msg success=$success + #my msg success=$success return $success } ArchiveFile instproc import {-dir -parent_id} { @@ -453,7 +456,6 @@ my log "new Photo $file_name" set photoFormObj [::xowiki::Weblog instantiate_forms \ -parent_id $parent_id -forms en:photo.form -package_id $package_id] - $photoFormObj create-new -parent_id $parent_id -name $file_name -nls_language en set photo_object [$photoFormObj create_form_page_instance \ -name en:$file_name \ -nls_language en_US \