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.250 -r1.251 --- openacs-4/packages/xowiki/tcl/package-procs.tcl 6 Nov 2011 03:13:39 -0000 1.250 +++ openacs-4/packages/xowiki/tcl/package-procs.tcl 25 Nov 2011 09:59:58 -0000 1.251 @@ -1105,7 +1105,13 @@ set name [string trimright $name \0] set (stripped_name) [string trimright $(stripped_name) \0] - if {$element eq "." || $element eq ".\0"} { + if {$element eq "" || $element eq "\0"} { + set folder_id [my folder_id] + array set "" [my item_info_from_id $folder_id] + set item_id $folder_id + set parent_id $(parent_id) + #my msg "SETTING item_id $item_id parent_id $parent_id // [array get {}]" + } elseif {$element eq "." || $element eq ".\0"} { array set "" [my item_info_from_id $parent_id] set item_id $parent_id set parent_id $(parent_id) 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.446 -r1.447 --- openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 8 Nov 2011 12:30:42 -0000 1.446 +++ openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 25 Nov 2011 09:59:58 -0000 1.447 @@ -1542,7 +1542,7 @@ array set "" [$package_id item_ref -default_lang [my lang] -parent_id $parent_id \ $(link)] } - #my msg [array get ""] + #my msg "link '$(link)' => [array get {}]" if {$label eq $arg} {set label $(link)} set item_name [string trimleft $(prefix):$(stripped_name) :] Index: openacs-4/packages/xowiki/www/admin/test.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/admin/Attic/test.tcl,v diff -u -r1.31 -r1.32 --- openacs-4/packages/xowiki/www/admin/test.tcl 20 May 2011 17:10:52 -0000 1.31 +++ openacs-4/packages/xowiki/www/admin/test.tcl 25 Nov 2011 09:59:58 -0000 1.32 @@ -831,6 +831,28 @@ && $(parent_id) eq $folder_id && $(item_id) == 0}} 1 "\n$test:\n [array get {}]\n " ################################ + test subsection "Absolute to toplevel:" + + set l "/f1" + set test [label "item_ref" "absolute existing topfolder short" $l] + array set "" [p item_ref -default_lang en -parent_id $folder_id $l] + ? {expr {$(link_type) eq "link" && $(prefix) eq "" && $(stripped_name) eq "f1" + && $(parent_id) eq $folder_id && $(item_id) == $f1_id}} 1 "\n$test:\n [array get {}]\n " + + set l "/f1/" + set test [label "item_ref" "absolute existing topfolder short slash" $l] + array set "" [p item_ref -default_lang en -parent_id $folder_id $l] + ? {expr {$(link_type) eq "link" && $(prefix) eq "" && $(stripped_name) eq "f1" + && $(parent_id) eq $folder_id && $(item_id) == $f1_id}} 1 "\n$test:\n [array get {}]\n " + + set l "/" ;# stripped name will be the name of the root folder + set test [label "item_ref" "just slash" $l] + array set "" [p item_ref -default_lang de -parent_id $folder_id $l] + ? {expr {$(link_type) eq "folder" && $(prefix) eq "" + && $(parent_id) == -100 && $(item_id) == $folder_id}} 1 "\n$test:\n [array get {}]\n " + + + ################################ test subsection "Relative to current folder:" set l "./parentpage"