Project

General

Profile

Actions

Defect #33548

closed

Column header is clickable even when the column is not actually sortable

Added by Vincent Robert over 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Issues list
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

Please find below a patch to fix the 'sortable?' method in QueryColumn class.

Currently, the method returns true if @sortable is False.
Therefore, some headers display a link when the column is actually not sortable (multi-value custom-fields columns in Projects page for instance).

Thank you for your work

diff --git a/app/models/query.rb b/app/models/query.rb
index 0dec7d211..c3311ffbf 100644
--- a/app/models/query.rb
+++ b/app/models/query.rb
@@ -51,7 +51,7 @@ class QueryColumn

   # Returns true if the column is sortable, otherwise false
   def sortable?
-    !@sortable.nil?
+    !@sortable.blank?
   end

   def sortable

Files

patch.diff (326 Bytes) patch.diff Vincent Robert, 2020-06-03 17:14
0003-Add-test-for-33548.patch (945 Bytes) 0003-Add-test-for-33548.patch Marius BĂLTEANU, 2021-03-13 15:14
Actions

Also available in: Atom PDF