Index: openacs-4/packages/xowiki/tcl/link-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/link-procs.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/packages/xowiki/tcl/link-procs.tcl 10 Oct 2006 09:32:44 -0000 1.11 +++ openacs-4/packages/xowiki/tcl/link-procs.tcl 8 Nov 2006 22:22:21 -0000 1.12 @@ -19,7 +19,7 @@ Link instproc init {} { set class [self class]::[my type] if {[my isclass $class]} {my class $class} - #my log "--L link has class [my info class]" + my log "--L link has class [my info class] // $class" } Link instproc resolve {} { #my log "--lookup of [my name]" @@ -103,9 +103,10 @@ my instvar name package_id label set page [my page] set item_id [my resolve] + #my log "-- image resolve for $page returned $item_id (name=$name, label=$label) " if {$item_id} { set base [::[my package_id] pretty_link -absolute [$page absolute_links] $name] -my log "--l fully quali [$page absolute_links], base=$base" + #my log "--l fully quali [$page absolute_links], base=$base" set link [export_vars -base $base {{m download}} ] $page lappend references [list $item_id [my type]] my render_found $link $label @@ -126,6 +127,14 @@ } Class create ::xowiki::Link::file -superclass ::xowiki::Link::image + ::xowiki::Link::file instproc resolve {} { + set item_id [next] + # my log "-- file, lookup of [my name] returned $item_id" + if {$item_id eq 0 && [regsub {^file:} [my name] image: name]} { + set item_id [::Generic::CrItem lookup -name $name -parent_id [my folder_id]] + } + return $item_id + } ::xowiki::Link::file instproc render_found {href label} { return "$label" @@ -172,7 +181,7 @@ while {1} { array set r [ns_cache eval xowiki_cache $key { set id [next] - if {$id == 0} break ;# don't cache + if {$id == 0 || $id eq ""} break ;# don't cache return [list item_id $id package_id [my package_id]] }] break 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.18 -r1.19 --- openacs-4/packages/xowiki/tcl/package-procs.tcl 7 Nov 2006 08:25:45 -0000 1.18 +++ openacs-4/packages/xowiki/tcl/package-procs.tcl 8 Nov 2006 22:22:21 -0000 1.19 @@ -227,9 +227,11 @@ set local_name $path } set name ${lang}:$local_name - if {[info exists name]} { - set item_id [::Generic::CrItem lookup -name $name -parent_id $folder_id] - my log "--try $name -> $item_id" + set item_id [::Generic::CrItem lookup -name $name -parent_id $folder_id] + my log "--try $name -> $item_id" + if {$item_id == 0 && $lang eq "file"} { + set item_id [::Generic::CrItem lookup -name image:$local_name -parent_id $folder_id] + my log "--try image:$local_name -> $item_id" } if {$item_id == 0} { set nname [my normalize_name $name]