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.332.2.24 -r1.332.2.25 --- openacs-4/packages/xowiki/tcl/package-procs.tcl 2 Jul 2019 15:13:46 -0000 1.332.2.24 +++ openacs-4/packages/xowiki/tcl/package-procs.tcl 2 Jul 2019 17:56:01 -0000 1.332.2.25 @@ -529,8 +529,11 @@ # can have children and same-named folders exist. # set found_id [:lookup -parent_id $parent_id -name $name] + #set found_id [::xo::dc get_value check_folder {select item_id from cr_items where parent_id = :parent_id and name = :name} 0] + #:log "-pretty_link: lookup [list :lookup -parent_id $parent_id -name $name] -> $found_id" if {$found_id != 0 && $page ne ""} { - #:log "named page named <$name> exists, $page is folder: [$page is_folder_page], path <$folder>" + :log "... named page <$name> exists <$found_id [$found_id name]), provided page <$page [$page name]>\ + folder [$page is_folder_page] link [$page is_link_page]" # # Do NOT add a language prefix for folders, links and newborn # pages. @@ -540,7 +543,7 @@ set found_id 0 } } - #:log "-pretty_link: found_id=$found_id name=$name,folder=$folder,lang=$lang" + :log "-pretty_link: found_id=$found_id name=$name,folder=$folder,lang=$lang,default_lang=$default_lang" if {$download} { # # Use the special download (file) syntax. Index: openacs-4/packages/xowiki/tcl/test/xowiki-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/test/xowiki-test-procs.tcl,v diff -u -r1.1.2.22 -r1.1.2.23 --- openacs-4/packages/xowiki/tcl/test/xowiki-test-procs.tcl 2 Jul 2019 14:14:34 -0000 1.1.2.22 +++ openacs-4/packages/xowiki/tcl/test/xowiki-test-procs.tcl 2 Jul 2019 17:56:01 -0000 1.1.2.23 @@ -58,12 +58,17 @@ set f3_id [xowiki::test::require_folder "f3" $f1_id $package_id] set subf3_id [xowiki::test::require_folder "subf3" $f3_id $package_id] set enpage_id [xowiki::test::require_page en:page $root_folder_id $package_id] + set p0_id [xowiki::test::require_page en:p0 $root_folder_id $package_id] set f1_p1_id [xowiki::test::require_page en:p1 $f1_id $package_id] ::xo::db::CrClass get_instance_from_db -item_id $enpage_id set enpage_pl [::$enpage_id pretty_link] aa_equals "Pretty link of en:page: $enpage_pl" $enpage_pl "/xowiki-test/page" + ::xo::db::CrClass get_instance_from_db -item_id $p0_id + set p0_pl [::$p0_id pretty_link] + aa_equals "Pretty link of p0 $p0_pl" $p0_pl "/xowiki-test/p0" + ::xo::db::CrClass get_instance_from_db -item_id $f1_p1_id set f1_p1_pl [::$f1_p1_id pretty_link] aa_equals "Pretty link of f1/page $f1_p1_pl" $f1_p1_pl "/xowiki-test/f1/p1" @@ -134,7 +139,7 @@ aa_true "can resolve $pretty_link1 => $enpage_id" \ [expr {[dict get $item_info1 item_id] eq $enpage_id}] - set folder_clash_id [xowiki::test::require_folder page $root_folder_id $package_id] + set folder_clash_id [xowiki::test::require_folder "page" $root_folder_id $package_id] ::xo::db::CrClass get_instance_from_db -item_id $folder_clash_id set pretty_link2 [::$folder_clash_id pretty_link] set item_info2 [$package_id item_info_from_url $pretty_link2] @@ -151,18 +156,19 @@ # link rendering # aa_section "render links (\[\[somelink\]\]" + ns_log notice "---render links---" + foreach pair [subst { + {page /page} + {./page /page} + {./page/ /page} {f1 /f1} {./f1 /f1} - {page /en:page} - {./page /en:page} - {page/ /page} - {./page/ /page} {f1/p1 /f1/p1} {f1/f3 /f1/f3} }] { lassign $pair link pattern - set l [$enpage_id create_link $link] + set l [::$p0_id create_link $link] set html [$l render] aa_true "render link \[\[$link\]\] -> *'$instance$pattern'*" [string match *'$instance$pattern'* $html] aa_log "[ns_quotehtml $html]"