Index: openacs-4/packages/xotcl-core/tcl/30-widget-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/30-widget-procs.tcl,v diff -u -r1.70.2.22 -r1.70.2.23 --- openacs-4/packages/xotcl-core/tcl/30-widget-procs.tcl 10 Mar 2021 10:45:25 -0000 1.70.2.22 +++ openacs-4/packages/xotcl-core/tcl/30-widget-procs.tcl 20 Apr 2021 09:35:56 -0000 1.70.2.23 @@ -836,18 +836,15 @@ # # Called interactively # - foreach {key value} [ns_set array [ns_parsequery [ns_conn query]]] { - if {$key in {"orderby" "__csrf_token"}} continue - lappend query [list $key $value] - } set base [ad_conn url] } else { # # Called in the background (e.g. from search renderer) # set base . } - set href [export_vars -base $base $query] + set href $base?[::xo::update_query [ns_conn query] $orderby_name $new_orderby] + html::a -href $href -title $title { html::t [:_ label] html::img -src $img -alt "" Index: openacs-4/packages/xotcl-core/tcl/context-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/context-procs.tcl,v diff -u -r1.75.2.22 -r1.75.2.23 --- openacs-4/packages/xotcl-core/tcl/context-procs.tcl 9 Mar 2021 21:27:19 -0000 1.75.2.22 +++ openacs-4/packages/xotcl-core/tcl/context-procs.tcl 20 Apr 2021 09:35:56 -0000 1.75.2.23 @@ -620,17 +620,20 @@ ad_proc -private ::xo::update_query {old_query var value} { - Replace in a URL-query old occurrences of var with new value. + Replace in a URL-query old occurrences of var with new value. - @return encoded HTTP query - } { + @return encoded HTTP query + } { set encodeCmd ns_urlencode if {$::xo::naviserver} {lappend encodeCmd --} set query [{*}$encodeCmd $var]=[{*}$encodeCmd $value] - foreach {key value} [ns_set array [ns_parsequery $old_query]] { - if {$key eq $var} continue - append query &[{*}$encodeCmd $key]=[{*}$encodeCmd $value] + + if {$old_query ne ""} { + foreach {key value} [ns_set array [ns_parsequery $old_query]] { + if {$key eq $var} continue + append query &[{*}$encodeCmd $key]=[{*}$encodeCmd $value] + } } return $query }