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.248.2.7 -r1.248.2.8 --- openacs-4/packages/xowiki/tcl/form-field-procs.tcl 6 Oct 2015 06:28:55 -0000 1.248.2.7 +++ openacs-4/packages/xowiki/tcl/form-field-procs.tcl 15 Oct 2015 11:39:10 -0000 1.248.2.8 @@ -3006,7 +3006,7 @@ -package_id [$object package_id] -parent_id [$object parent_id] \ -item_id [$object item_id] - set html [$item_id render] + set html [$item_id render] $item_id unset __RESOLVE_LOCAL $item_id reset_resolve_context 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.96 -r1.96.2.1 --- openacs-4/packages/xowiki/tcl/link-procs.tcl 31 Jul 2015 07:40:31 -0000 1.96 +++ openacs-4/packages/xowiki/tcl/link-procs.tcl 15 Oct 2015 11:39:11 -0000 1.96.2.1 @@ -394,11 +394,11 @@ 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) " + #my log "-- image resolve for $page returned $item_id (name=$name, label=$label)" if {$item_id} { set link [$package_id pretty_link -download true -query [my query] \ -absolute [$page absolute_links] -parent_id [my parent_id] $name] - #my log "--l fully quali [$page absolute_links], base=$base" + #my log "--l fully quali [$page absolute_links], link=$link" $page references resolved [list $item_id [my type]] my render_found $link $label } else { 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.291.2.3 -r1.291.2.4 --- openacs-4/packages/xowiki/tcl/package-procs.tcl 2 Sep 2015 10:45:47 -0000 1.291.2.3 +++ openacs-4/packages/xowiki/tcl/package-procs.tcl 15 Oct 2015 11:39:11 -0000 1.291.2.4 @@ -1472,17 +1472,27 @@ } array set "" [my prefixed_lookup -parent_id $(parent_id) \ -default_lang $default_lang -lang $(lang) -stripped_name $(stripped_name)] - #my msg "prefixed_lookup '$(stripped_name)' returns [array get {}]" + my log "prefixed_lookup '$(stripped_name)' returns [array get {}]" if {$(item_id) == 0} { - # check symlink (todo should happen in package->lookup?) + # + # check symlink (todo: should this happen in package->lookup?) + # ::xo::db::CrClass get_instance_from_db -item_id $(parent_id) - if {[$(parent_id) is_link_page] && [$(parent_id) is_folder_page]} { + if {[$(parent_id) is_link_page]} { + # + # We encompassed a link to a page or folder, treat both the same way. + # set target [$(parent_id) get_target_from_link_page] $target set_resolve_context -package_id [my id] -parent_id $(parent_id) - #my msg "SYMLINK PREFIXED $target ([$target name]) set_resolve_context -package_id [my id] -parent_id $(parent_id)" + + #my log "SYMLINK PREFIXED $target ([$target name]) set_resolve_context -package_id [my id] -parent_id $(parent_id)" array set "" [[$target package_id] prefixed_lookup -parent_id [$target item_id] \ -default_lang $default_lang -lang $(lang) -stripped_name $(stripped_name)] + # + # We can't reset the resolve context here, since it is also + # required for rendering the target + # } } 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.485.2.10 -r1.485.2.11 --- openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 6 Oct 2015 12:36:58 -0000 1.485.2.10 +++ openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 15 Oct 2015 11:39:11 -0000 1.485.2.11 @@ -2145,6 +2145,7 @@ -parent_id $parent_id \ ${lang}:$stripped_name] set (link_type) language + } elseif {[regexp {^[.]SELF[.]/(.*)$} $(link) _ (link)]} { # # Remove ".SELF./" from the path and search for the named @@ -2157,7 +2158,7 @@ -default_lang [my lang] \ -parent_id [my physical_item_id] \ $(link)] - #my log "returns [array get {}]" + #my log "SELF-LINK returns [array get {}]" } else { # @@ -2245,10 +2246,11 @@ if {[my exists __RESOLVE_LOCAL]} { my set_resolve_context -package_id [my physical_package_id] -parent_id [my physical_parent_id] + $l parent_id [my item_id] set html [$l render] my reset_resolve_context } else { - set html [$l render] + set html [$l render] } if {[info commands $l] ne ""} {