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 -N -r1.332.2.108 -r1.332.2.109 --- openacs-4/packages/xowiki/tcl/package-procs.tcl 29 Jan 2022 18:27:07 -0000 1.332.2.108 +++ openacs-4/packages/xowiki/tcl/package-procs.tcl 21 Feb 2022 11:53:55 -0000 1.332.2.109 @@ -2261,11 +2261,12 @@ -parent_id $search_parent_id \ $link] - #:msg "[:instance_name] (root ${:folder_id}) item-ref for '$link' search parent $search_parent_id, parent $parent_id, returns\n[array get {}]" + #:msg "[:instance_name] (root ${:folder_id}) item-ref for '$link' search parent $search_parent_id, parent $parent_id, returns\n[array get {}]" + if {$(item_id)} { set page [::xo::db::CrClass get_instance_from_db -item_id $(item_id)] if {[$page package_id] ne ${:id} || [$page parent_id] != $(parent_id)} { - #:msg "set_resolve_context site_wide_pages ${:id} and -parent_id $parent_id" + #:log "set_resolve_context site_wide_pages ${:id} and -parent_id $parent_id" $page set_resolve_context -package_id ${:id} -parent_id $parent_id } return $page @@ -2909,7 +2910,7 @@ ::xo::db::sql::content_revision del -revision_id $revision_id } - Package ad_instproc www-delete {-item_id -name -parent_id} { + Package ad_instproc www-delete {-item_id -name -parent_id -return_url} { This web-callable "delete" method does not require an instantiated object, while the class-specific delete methods in xowiki-procs need these. @@ -2918,7 +2919,8 @@ While the class specific methods are used from the application pages, the package_level method is used from the admin pages. - If no item_id given, take it from the query parameter + If no "item_id", "name" or "return_url" are given, take it from + the query parameters. } { #:log "--D delete [self args]" @@ -2934,6 +2936,11 @@ set name [:query_parameter name] } + if {![info exists return_url]} { + set return_url [:query_parameter return_url:localurl \ + [ad_urlencode_folder_path ${:package_url}]] + } + if {$item_id eq ""} { set item_info [:item_info_from_url -with_package_prefix false $name] if {[dict get $item_info item_id] == 0} { @@ -2986,7 +2993,7 @@ } else { :log "--D nothing to delete!" } - :returnredirect [:query_parameter "return_url" [ad_urlencode_folder_path ${:package_url}]] + :returnredirect $return_url } #