Commit 6a6720c7 authored by Mathias Goebel's avatar Mathias Goebel 🎠
Browse files

ommiting break on empty string to integer conversion

parent 692d6387
......@@ -31,8 +31,8 @@ function fsearch:results($node as node(), $model as map(*)) as map()* {
order by util:eval($order-by) ascending
return $hit
let $num := xs:integer(config:module-param-value($model, "faceted-search", "hits-per-page"))
let $pages := ceiling(count($hits) div $num)
let $num := try{ xs:integer(config:module-param-value($model, "faceted-search", "hits-per-page")) } catch * {0}
let $pages := try { ceiling(count($hits) div $num) } catch * { 0 }
let $start := $page * $num - $num + 1
return
......@@ -61,7 +61,7 @@ function fsearch:hitstart($node as node(), $model as map(*)) {
declare
%templates:wrap
function fsearch:hitend($node as node(), $model as map(*)) {
let $num := xs:integer(config:module-param-value($model, "faceted-search", "hits-per-page"))
let $num := try { xs:integer(config:module-param-value($model, "faceted-search", "hits-per-page")) } catch * {0}
let $res := $model("start") + $num - 1
return if($res > $model("totalhits"))
then $model("totalhits")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment