Index: openacs-4/packages/xowiki/tcl/xowiki-utility-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-utility-procs.tcl,v diff -u -N -r1.57.2.2 -r1.57.2.3 --- openacs-4/packages/xowiki/tcl/xowiki-utility-procs.tcl 8 May 2019 19:59:57 -0000 1.57.2.2 +++ openacs-4/packages/xowiki/tcl/xowiki-utility-procs.tcl 12 May 2019 16:31:12 -0000 1.57.2.3 @@ -723,16 +723,25 @@ {-publish_status "ready|live|expired"} } { - Change Page Order for pages by renumbering and filling - gaps. Parameter clean is just for inserts. + Update page_order attributes for pages by renumbering and filling + gaps. + + @param from list of page_orders before a move/insert operation + @param to list of page_orders after a move/insert operation + @param clean list of page_orders for insert operatons, to update + the hierarchy from where items were moved to the new hierarchy. } { #set from {1.2 1.3 1.4}; set to {1.3 1.4 1.2}; set clean {...} #set from {1.2 1.3 1.4}; set to {1.3 1.4 2.1 1.2}; set clean {2.1} #set from {1 2}; set to {1 1.2 2}; set clean {1.2 1.3 1.4} - if {$from eq "" || $to eq "" || [llength $to]-[llength $from] >1 || [llength $to]-[llength $from]<0} { + if {$from eq "" + || $to eq "" + || [llength $to]-[llength $from] > 1 + || [llength $to]-[llength $from] < 0 + } { ad_log warning "unreasonable request to change page_order from='$from', to='$to'" return } @@ -758,12 +767,18 @@ break } } - if {![info exists inserted]} {error "invalid 'to' list (no inserted element detected)"} + if {![info exists inserted]} { + error "invalid 'to' list (no inserted element detected)" + } # # Compute the remaining list. # set remaining [list] - foreach e $clean {if {$e ne $inserted} {lappend remaining $e}} + foreach e $clean { + if {$e ne $inserted} { + lappend remaining $e + } + } # # Compute rename commands for it. #