Browse Source

Bug 27807: (QA follow-up) Unique values only

This patch filters the final _order_by clause such that we only have
unique data fields present and we take the first occurence of a field.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
21.05.x
Martin Renvoize 2 years ago
committed by Jonathan Druart
parent
commit
8424f402be
  1. 4
      koha-tmpl/intranet-tmpl/prog/js/datatables.js

4
koha-tmpl/intranet-tmpl/prog/js/datatables.js

@ -640,9 +640,9 @@ jQuery.fn.dataTable.ext.errMode = function(settings, note, message) {
var order_by = options.columns[order_col].data;
order_by = order_by.split(':');
var order_dir = e.dir == 'asc' ? '+' : '-';
orderArray.push(order_by.map(x => order_dir + (!x.includes('.')?'me.'+x:x)).join(','));
Array.prototype.push.apply(orderArray,order_by.map(x => order_dir + (!x.includes('.')?'me.'+x:x)));
});
dataSet._order_by = orderArray.join(',');
dataSet._order_by = orderArray.filter((v, i, a) => a.indexOf(v) === i).join(',');
}
return dataSet;

Loading…
Cancel
Save