]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 577575: If percentage_complete is a column in the buglist, remaining_time
authorMax Kanat-Alexander <mkanat@bugzilla.org>
Thu, 8 Jul 2010 23:22:08 +0000 (16:22 -0700)
committerMax Kanat-Alexander <mkanat@bugzilla.org>
Thu, 8 Jul 2010 23:22:08 +0000 (16:22 -0700)
must also be selected from the database for PostgreSQL.
r=mkanat, a=mkanat (module owner)

Bugzilla/Search.pm

index b7c2f06ba08f0d4cc18d58238ce4286cbad0af1b..68144b376c853a39b951cc0ac1eb22bbe0835ff4 100644 (file)
@@ -538,6 +538,15 @@ sub init {
         push(@supptables, "LEFT JOIN keywords ON keywords.bug_id = bugs.bug_id");
         push(@supptables, "LEFT JOIN keyworddefs ON keyworddefs.id = keywords.keywordid");
     }
+    
+    # Calculating percentage_complete requires remaining_time. Mostly,
+    # we just need remaining_time in the GROUP_BY, but it simplifies
+    # things to just add it in the SELECT.
+    if (grep($_ eq 'percentage_complete', @fields)
+        and !grep($_ eq 'remaining_time', @fields))
+    {
+        push(@fields, 'remaining_time');
+    }
 
     # If the user has selected all of either status or resolution, change to
     # selecting none. This is functionally equivalent, but quite a lot faster.