Defect #6968

Sorting of issues in Gantt

Added by alexis coudeyras almost 11 years ago. Updated over 8 years ago.

Status:ClosedStart date:2010-11-24
Priority:NormalDue date:
Assignee:-% Done:


Target version:-
Resolution:Duplicate Affected version:


I've got a problem with the sorting of issues in the Gantt. Some issues are not affected to their parent but to another parent.
I don't think it's possible to sort the list of issues correctly with a comparer like it's done in gantt.rb, so i've modified the gantt.rb in lib/redmine/helpers. I have added a private function :

def gantt_issue_sort(all)
def get_sorted_childs(id, issues)
childs = {| i|
i.parent_id == id
}.sort {|x, y|
gantt_start_compare(x, y)
def sort(id, issues, result)
childs = get_sorted_childs(id, issues)
childs.each do |c|
result << c
sort(, issues, result)
result = []
issues = {|i| i.is_a?(Issue)}
others = {|i| not i.is_a?(Issue)}
sort(nil, issues, result)
result += others

and i have modified the def events=(e), just before the reject i have added :
@events = gantt_issue_sort(@events)

It's just a quick and dirty fix by somebody who has no experience in ruby programming, but i thought it might help to send you my code.

Related issues

Related to Redmine - Patch #5438: Patch repairing rendering of subtasks in gantt diagram Closed 2010-05-04 2010-05-04
Duplicates Redmine - Defect #7335: Sorting issues in gantt by date, not by id Closed 2011-01-15


#1 Updated by Sepp _ almost 11 years ago

What is the difference to the solution in #5438ß

#2 Updated by alexis coudeyras almost 11 years ago

I've tried the patch in #5438, it seems to work (and his patch is better than mine). My datas have changed a lot, so it's difficult to tell if patch #5438 really solve my problem. I keep it and check if it's ok.

#3 Updated by Toshi MARUYAMA over 8 years ago

  • Status changed from New to Closed
  • Resolution set to Duplicate

I close this issue as duplicate with #7335 because #7335 has more discussion.

Also available in: Atom PDF