From f7c81d16440a0d760a527d05d2139c2775beb7cb Mon Sep 17 00:00:00 2001 From: "tory.berra" Date: Tue, 7 May 2024 10:17:28 -0500 Subject: [PATCH 1/2] SearchPaneOptions and SearchBuilderOptions should include all selected columns in the GROUP BY clause. --- DataTables-Editor-Server/SearchBuilderOptions.cs | 4 ++-- DataTables-Editor-Server/SearchPaneOptions.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DataTables-Editor-Server/SearchBuilderOptions.cs b/DataTables-Editor-Server/SearchBuilderOptions.cs index 959e123..9ec6f28 100644 --- a/DataTables-Editor-Server/SearchBuilderOptions.cs +++ b/DataTables-Editor-Server/SearchBuilderOptions.cs @@ -245,11 +245,11 @@ internal List> Exec(Field fieldIn, Editor editor, Lis .Table(this._table) .LeftJoin(_leftJoin); - if(fieldIn.Apply("get") && fieldIn.GetValue() == null){ + if(fieldIn.Apply("get") && fieldIn.GetValue() == null) { query .Get(this._value + " as value") .Get(_label + " as label") - .GroupBy(this._value); + .GroupBy(this._value + ", " + _label); } var res = query.Exec() diff --git a/DataTables-Editor-Server/SearchPaneOptions.cs b/DataTables-Editor-Server/SearchPaneOptions.cs index 0a83ec0..28585c3 100644 --- a/DataTables-Editor-Server/SearchPaneOptions.cs +++ b/DataTables-Editor-Server/SearchPaneOptions.cs @@ -277,7 +277,7 @@ internal List> Exec(Field fieldIn, Editor editor, Lis .Table(table) .Get(label + " as label") .Get(value + " as value") - .GroupBy(value) + .GroupBy(value + ", " + label) .Where(_where) .LeftJoin(join); From f1a12004cf23ab8495daf474d6217628e257f3ea Mon Sep 17 00:00:00 2001 From: "tory.berra" Date: Tue, 7 May 2024 10:17:39 -0500 Subject: [PATCH 2/2] Fix typo in existing XML docs --- DataTables-Editor-Server/Field.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DataTables-Editor-Server/Field.cs b/DataTables-Editor-Server/Field.cs index 3dc0120..24d98ed 100644 --- a/DataTables-Editor-Server/Field.cs +++ b/DataTables-Editor-Server/Field.cs @@ -739,7 +739,7 @@ public Field Xss(Boolean flag) /// Called by the Editor / Join class instances - not expected for general /// consumption - internal. /// - /// Direction that the data is travelling - 'get' is reading DB data, `create` and `edit` for writing to the DB + /// Direction that the data is traveling - 'get' is reading DB data, `create` and `edit` for writing to the DB /// Data submitted from the client-side when setting. /// true if the field should be used in the get / set. internal bool Apply(string action, Dictionary data = null)