Skip to content

Commit 489be17

Browse files
committed
ID creation bugfix
1 parent 3b215f5 commit 489be17

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

server/services/searchBASE.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
$precomputed_id = (isset($_POST["unique_id"]))?($_POST["unique_id"]):(null);
1212

1313
$params_array = array("document_types", "sorting", "min_descsize");
14-
$optional_get_params = ["repo", "coll", "vis_type", "q_advanced", "lang_id", "custom_title", "exclude_date_filters", "today", "from", "to", "custom_clustering"];
14+
$optional_get_params = ["repo", "coll", "vis_type", "q_advanced", "lang_id", "custom_title", "exclude_date_filters", "from", "to", "custom_clustering"];
15+
1516

1617
function filterEmptyString($value)
1718
{
@@ -44,6 +45,23 @@ function filterEmptyString($value)
4445
unset($params_array["from"], $params_array["to"]);
4546
}
4647

48+
// re-establish historic order for backwards ID compatibility
49+
$historic_params_order = array("from", "to", "document_types", "sorting", "min_descsize", "repo");
50+
$reordered_params = array();
51+
foreach($historic_params_order as $param) {
52+
if (isset($post_params[$param])) {
53+
$reordered_params[] = $param;
54+
}
55+
}
56+
foreach($params_array as $param) {
57+
if (!in_array($param, $reordered_params)) {
58+
$reordered_params[] = $param;
59+
}
60+
}
61+
$params_array = $reordered_params;
62+
63+
64+
4765
$result = search("base", $dirty_query
4866
, $post_params, $params_array
4967
, true

0 commit comments

Comments
 (0)