diff --git a/mozilla/webtools/bugzilla/checksetup.pl b/mozilla/webtools/bugzilla/checksetup.pl index bf8a39ff0e1..f50d4e4c007 100755 --- a/mozilla/webtools/bugzilla/checksetup.pl +++ b/mozilla/webtools/bugzilla/checksetup.pl @@ -1833,7 +1833,7 @@ AddFDef("alias", "Alias", 0); AddFDef("everconfirmed", "Ever Confirmed", 0); AddFDef("reporter_accessible", "Reporter Accessible", 0); AddFDef("cclist_accessible", "CC Accessible", 0); -AddFDef("bug_group", "Bug Group", 0); +AddFDef("bug_group", "Group", 0); # Oops. Bug 163299 $dbh->do("DELETE FROM fielddefs WHERE name='cc_accessible'"); @@ -3229,7 +3229,7 @@ if (GetFieldDef("profiles", "groupset")) { } } # replace old activity log groupset records with groups - AddFDef("bug_group", "Bug Group", 0); + AddFDef("bug_group", "Group", 0); $sth = $dbh->prepare("SELECT fieldid FROM fielddefs WHERE name = " . $dbh->quote('bug_group')); $sth->execute(); my ($bgfid) = $sth->fetchrow_array; diff --git a/mozilla/webtools/bugzilla/globals.pl b/mozilla/webtools/bugzilla/globals.pl index ee328f2e8e5..96e184e1e46 100644 --- a/mozilla/webtools/bugzilla/globals.pl +++ b/mozilla/webtools/bugzilla/globals.pl @@ -706,6 +706,12 @@ sub CanSeeBug { # if no groups are found --> user is permitted to access # if no user is found for a group --> user is not permitted to access + # Note: Since this needs to establish if a user is absent for ANY of + # the groups the bug requires, the result of the JOIN is sorted + # by the user_id. Since MySQL places NULLs ahead of numbers in ALL sorts + # (specified in the MySQL documentation) and postgreSQL places NULLs + # ahead of number in descending sorts only, sorting descending makes + # the first row contain the NULL value if there is going to be one. my $query = "SELECT bugs.bug_id, reporter, assigned_to, qa_contact, reporter_accessible, cclist_accessible, ISNULL(cc.who) = 0, @@ -719,7 +725,7 @@ sub CanSeeBug { user_group_map.group_id = bug_group_map.group_id AND user_group_map.isbless = 0 AND user_group_map.user_id = $userid - WHERE bugs.bug_id = $id ORDER BY user_group_map.user_id"; + WHERE bugs.bug_id = $id ORDER BY user_group_map.user_id DESC"; PushGlobalSQLState(); SendSQL($query); my ($found_id, $reporter, $assigned_to, $qa_contact,