From 02c2ccd62ee3648d2341058ef6c7efa088ee41f5 Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 9 Jul 2024 11:00:02 +0200 Subject: [PATCH 1/2] stash filterState --- modules/ticket/back/methods/ticket/filter.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/ticket/back/methods/ticket/filter.js b/modules/ticket/back/methods/ticket/filter.js index 899fe05cd..8d93fb993 100644 --- a/modules/ticket/back/methods/ticket/filter.js +++ b/modules/ticket/back/methods/ticket/filter.js @@ -347,6 +347,17 @@ module.exports = Self => { if (hasWhere) stmt.merge(conn.makeWhere(problems)); + if (filter.order) { + const index = filter.order.findIndex(o => o.includes('stateFk')); + if (index > -1) { + filter.order = [ + ...filter.order.slice(0, index), + 'refFk ' + filter.order[index].split(' ')[1], + ...filter.order.slice(index) + ]; + } + } + stmt.merge(conn.makeOrderBy(filter.order)); stmt.merge(conn.makeLimit(filter)); const ticketsIndex = stmts.push(stmt) - 1; From 944cf3baa3ef35b0a30c22eeea1f1bcb54bb0545 Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 9 Jul 2024 11:44:43 +0200 Subject: [PATCH 2/2] refs #7694 hotfix filter --- modules/ticket/back/methods/ticket/filter.js | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/ticket/back/methods/ticket/filter.js b/modules/ticket/back/methods/ticket/filter.js index 8d93fb993..0823b38b8 100644 --- a/modules/ticket/back/methods/ticket/filter.js +++ b/modules/ticket/back/methods/ticket/filter.js @@ -348,6 +348,7 @@ module.exports = Self => { stmt.merge(conn.makeWhere(problems)); if (filter.order) { + if (typeof filter.order == 'string') filter.order = [filter.order]; const index = filter.order.findIndex(o => o.includes('stateFk')); if (index > -1) { filter.order = [