Skip to content
Snippets Groups Projects
Commit 9cb9cec0 authored by Alex ORLUC's avatar Alex ORLUC
Browse files

FIX #5207 fix order by identifier

parent 81e9a9f2
No related branches found
No related tags found
No related merge requests found
......@@ -103,14 +103,14 @@ if (isset($whereAttach) && $whereAttach <> '') $where .= $whereAttach;
$order_field = $list->getOrderField();
if (!empty($order_field) && !empty($order)){
if($_REQUEST['order_field'] == 'identifier'){
$orderstr = "order by regexp_replace(identifier, '[^a-zA-Z]', '', 'g') ".$order.", regexp_replace(identifier, '[^0-9]', '', 'g')::bigint"." ".$order;
$orderstr = "order by order_alphanum(identifier)"." ".$order;
}else{
$orderstr = "order by ".$order_field." ".$order;
}
} else {
$list->setOrder();
$list->setOrderField('identifier');
$orderstr = "order by attachment_type asc, regexp_replace(identifier, '[^a-zA-Z]', '', 'g') DESC, regexp_replace(identifier, '[^0-9]', '', 'g')::bigint DESC";
$orderstr = "order by attachment_type asc, order_alphanum(identifier) DESC";
}
$parameters = '';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment