Project

General

Profile

Actions

Defect #43524

open

Incorrect sorting when using "Subproject of" (parent project) as primary sort key in Project List view

Added by ak iwasaki about 13 hours ago. Updated about 13 hours ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Projects
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

Description

In the Project List view, when "Subproject of" (parent project) field is included as the primary sort key and the other field as a secondary key, the sorting result becomes incorrect.

Cause:

In models/project_query.rb line 42
QueryColumn.new(:parent_id, :sortable => "#{Project.table_name}.lft ASC", :default_order => 'desc', :caption => :field_parent),

However, #{Project.table_name}.lft ASC represents the hierarchical structure itself. Even projects with the same name can have different lft values, and when this is included as a sort key, a secondary sort key does not work correctly.

The following definition appears to be correct:

QueryColumn.new(:parent_id, :sortable => "#{Project.table_name}.parent_id", :default_order => 'desc', :caption => :field_parent),
Actions

Also available in: Atom PDF