From 640ec1663b430fa616c2d5af14edbd6dafb85a89 Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Mon, 15 Aug 2011 20:38:08 +0800 Subject: Bug 678959: Make GenerateUniqueToken work for all tables r=LpSolit, a=LpSolit --- Bugzilla/Token.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bugzilla/Token.pm b/Bugzilla/Token.pm index 69751e905..c339c5984 100644 --- a/Bugzilla/Token.pm +++ b/Bugzilla/Token.pm @@ -245,7 +245,7 @@ sub GenerateUniqueToken { $column ||= "token"; my $dbh = Bugzilla->dbh; - my $sth = $dbh->prepare("SELECT userid FROM $table WHERE $column = ?"); + my $sth = $dbh->prepare("SELECT 1 FROM $table WHERE $column = ?"); while ($duplicate) { ++$tries; -- cgit v1.2.3-24-g4f1b From 63efc1fab453cd0c035890dd0641e90e581f6fb4 Mon Sep 17 00:00:00 2001 From: Kent Rogers Date: Mon, 15 Aug 2011 15:15:44 +0200 Subject: Bug 537759: The "Description" field for attachments should be highlighted as being mandatory r/a=LpSolit --- template/en/default/attachment/createformcontents.html.tmpl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/template/en/default/attachment/createformcontents.html.tmpl b/template/en/default/attachment/createformcontents.html.tmpl index f7b86f884..5b04382b6 100644 --- a/template/en/default/attachment/createformcontents.html.tmpl +++ b/template/en/default/attachment/createformcontents.html.tmpl @@ -43,10 +43,11 @@ - : + : Describe the attachment briefly.
- + -- cgit v1.2.3-24-g4f1b From 92944f05e0626b212a17c4a0641c78453805a4c3 Mon Sep 17 00:00:00 2001 From: Max Kanat-Alexander Date: Mon, 15 Aug 2011 17:48:26 -0700 Subject: Bug 460074: Make post_bug.cgi use should_set for array fields, so they are undef in Bugzilla::Bug->create if not passed to post_bug. This fixes a bug with the guided bug form creating bugs without any groups. r=LpSolit, a=mkanat --- post_bug.cgi | 9 ++++++--- template/en/default/bug/create/create.html.tmpl | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/post_bug.cgi b/post_bug.cgi index 6d6ed746c..6ca46fb3c 100755 --- a/post_bug.cgi +++ b/post_bug.cgi @@ -153,14 +153,17 @@ my %bug_params; foreach my $field (@bug_fields) { $bug_params{$field} = $cgi->param($field); } -$bug_params{'cc'} = [$cgi->param('cc')]; -$bug_params{'groups'} = [$cgi->param('groups')]; -$bug_params{'comment'} = $comment; +foreach my $field (qw(cc groups)) { + next if !$cgi->should_set($field); + $bug_params{$field} = [$cgi->param($field)]; +} +$bug_params{'comment'} = $comment; my @multi_selects = grep {$_->type == FIELD_TYPE_MULTI_SELECT && $_->enter_bug} Bugzilla->active_custom_fields; foreach my $field (@multi_selects) { + next if !$cgi->should_set($field->name); $bug_params{$field->name} = [$cgi->param($field->name)]; } diff --git a/template/en/default/bug/create/create.html.tmpl b/template/en/default/bug/create/create.html.tmpl index 8604f0839..ee19ab5d6 100644 --- a/template/en/default/bug/create/create.html.tmpl +++ b/template/en/default/bug/create/create.html.tmpl @@ -665,6 +665,7 @@ TUI_hide_default('attachment_text_field');
+ [% FOREACH group = product.groups_available %] Date: Tue, 16 Aug 2011 03:15:05 +0200 Subject: Bug 582209: Bugzilla::DB::Oracle::adjust_statement() LIMIT code corrupts sub-selects r/a=mkanat --- Bugzilla/DB/Oracle.pm | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/Bugzilla/DB/Oracle.pm b/Bugzilla/DB/Oracle.pm index 9fdacf24c..f444129e1 100644 --- a/Bugzilla/DB/Oracle.pm +++ b/Bugzilla/DB/Oracle.pm @@ -379,20 +379,17 @@ sub adjust_statement { if ($new_sql !~ /\bWHERE\b/) { $new_sql = $new_sql." WHERE 1=1"; } - my ($before_where, $after_where) = split /\bWHERE\b/i,$new_sql; - if (defined($offset)) { - if ($new_sql =~ /(.*\s+)FROM(\s+.*)/i) { - my ($before_from,$after_from) = ($1,$2); - $before_where = "$before_from FROM ($before_from," - . " ROW_NUMBER() OVER (ORDER BY 1) R " - . " FROM $after_from ) "; - $after_where = " R BETWEEN $offset+1 AND $limit+$offset"; - } - } else { - $after_where = " rownum <=$limit AND ".$after_where; - } - - $new_sql = $before_where." WHERE ".$after_where; + my ($before_where, $after_where) = split(/\bWHERE\b/i, $new_sql, 2); + if (defined($offset)) { + my ($before_from, $after_from) = split(/\bFROM\b/i, $new_sql, 2); + $before_where = "$before_from FROM ($before_from," + . " ROW_NUMBER() OVER (ORDER BY 1) R " + . " FROM $after_from ) "; + $after_where = " R BETWEEN $offset+1 AND $limit+$offset"; + } else { + $after_where = " rownum <=$limit AND ".$after_where; + } + $new_sql = $before_where." WHERE ".$after_where; } return $new_sql; } -- cgit v1.2.3-24-g4f1b From f89f20583287fd49e54f4e0818f2d7ea46b58034 Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Tue, 16 Aug 2011 03:32:06 +0200 Subject: Bug 654496: Duplicate bug detection doesn't work when using Oracle r/a=mkanat --- Bugzilla/Bug.pm | 4 ++-- Bugzilla/DB/Oracle.pm | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 40bf3af2e..c9ccf541d 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -554,8 +554,8 @@ sub possible_duplicates { FROM bugs INNER JOIN bugs_fulltext ON bugs.bug_id = bugs_fulltext.bug_id WHERE ($where_sql) $product_sql - ORDER BY relevance DESC, bug_id DESC - LIMIT $sql_limit", {Slice=>{}}); + ORDER BY relevance DESC, bug_id DESC " . + $dbh->sql_limit($sql_limit), {Slice=>{}}); my @actual_dupe_ids; # Resolve duplicates into their ultimate target duplicates. diff --git a/Bugzilla/DB/Oracle.pm b/Bugzilla/DB/Oracle.pm index f444129e1..d91eb428e 100644 --- a/Bugzilla/DB/Oracle.pm +++ b/Bugzilla/DB/Oracle.pm @@ -177,7 +177,7 @@ sub sql_fulltext_search { my ($self, $column, $text, $label) = @_; $text = $self->quote($text); trick_taint($text); - return "CONTAINS($column,$text,$label)", "SCORE($label)"; + return "CONTAINS($column,$text,$label) > 0", "SCORE($label)"; } sub sql_date_format { -- cgit v1.2.3-24-g4f1b From 32ca131f3518873f80690b8bf51b32337c422927 Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Tue, 16 Aug 2011 03:44:09 +0200 Subject: Bug 678772: version.pm 0.92 and newer forbids negative values, making checksetup.pl to fail r/a=mkanat --- Bugzilla/Install/Requirements.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Bugzilla/Install/Requirements.pm b/Bugzilla/Install/Requirements.pm index 8825eb3a7..ef4bf3d22 100644 --- a/Bugzilla/Install/Requirements.pm +++ b/Bugzilla/Install/Requirements.pm @@ -717,8 +717,9 @@ sub _checking_for { # show "ok" or "not found". if (exists $params->{found}) { my $found_string; - # We do a string compare in case it's non-numeric. - if ($found and $found eq "-1") { + # We do a string compare in case it's non-numeric. We make sure + # it's not a version object as negative versions are forbidden. + if ($found && !ref($found) && $found eq '-1') { $found_string = install_string('module_not_found'); } elsif ($found) { -- cgit v1.2.3-24-g4f1b From 38ff922b0f904d170d4f63742394e902a270ac24 Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Tue, 16 Aug 2011 13:24:10 +0200 Subject: Bug 678844: When trying to edit a non-existent classification, the error message has missing words r=glob a=LpSolit --- template/en/default/global/user-error.html.tmpl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl index 5af39dc80..35640b220 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -1790,6 +1790,10 @@ attachment [% ELSIF class == "Bugzilla::User" %] user + [% ELSIF class == "Bugzilla::Classification" %] + classification + [% ELSIF class == "Bugzilla::Product" %] + product [% ELSIF class == "Bugzilla::Component" %] component [% ELSIF class == "Bugzilla::Version" %] @@ -1808,8 +1812,6 @@ group [% ELSIF class == "Bugzilla::Keyword" %] keyword - [% ELSIF class == "Bugzilla::Product" %] - product [% ELSIF class == "Bugzilla::Search::Recent" %] recent search [% ELSIF class == "Bugzilla::Search::Saved" %] -- cgit v1.2.3-24-g4f1b From f899ca9ad20457c699e68730eceee6bb5ba01c6c Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Tue, 16 Aug 2011 23:33:05 +0200 Subject: Bug 679449: Add a link to duplicates.cgi from report.cgi r=dkl a=LpSolit --- template/en/default/reports/menu.html.tmpl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/template/en/default/reports/menu.html.tmpl b/template/en/default/reports/menu.html.tmpl index 5f26ac335..5e19b1209 100644 --- a/template/en/default/reports/menu.html.tmpl +++ b/template/en/default/reports/menu.html.tmpl @@ -57,6 +57,10 @@ line graphs, bar and pie charts. [% END %] +
  • + Duplicates - + list of most frequently reported [% terms.bugs %]. +
  • [% Hook.process('current_state') %] -- cgit v1.2.3-24-g4f1b From 8713e6f943fe4bb02972199405ab504f4f3b903d Mon Sep 17 00:00:00 2001 From: Tiago Mello Date: Tue, 16 Aug 2011 19:05:53 -0300 Subject: Bug 672947: Add 'require Bugzilla::BugMail' in Bugzilla::Bug->_send_bugmail and remove unnecessary module imports in process_bug.cgi. r/a=LpSolit --- Bugzilla/Bug.pm | 2 ++ process_bug.cgi | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index c9ccf541d..6fdab3645 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -1217,6 +1217,8 @@ sub send_changes { sub _send_bugmail { my ($params, $vars) = @_; + require Bugzilla::BugMail; + my $results = Bugzilla::BugMail::Send($params->{'id'}, $params->{'forced'}, $params); diff --git a/process_bug.cgi b/process_bug.cgi index acb359f63..382ee8b59 100755 --- a/process_bug.cgi +++ b/process_bug.cgi @@ -48,8 +48,6 @@ use lib qw(. lib); use Bugzilla; use Bugzilla::Constants; use Bugzilla::Bug; -use Bugzilla::BugMail; -use Bugzilla::Mailer; use Bugzilla::User; use Bugzilla::Util; use Bugzilla::Error; -- cgit v1.2.3-24-g4f1b From 80040dc6c543a114d4e21cd967ba5da7da04142e Mon Sep 17 00:00:00 2001 From: Tiago Mello Date: Tue, 16 Aug 2011 19:52:45 -0300 Subject: Bug 678357: Fix 'limit' parameter in the saved searches results r/a=mkanat --- buglist.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buglist.cgi b/buglist.cgi index 7549063a4..bf8b443e6 100755 --- a/buglist.cgi +++ b/buglist.cgi @@ -766,7 +766,7 @@ if ($fulltext and grep { /^relevance/ } @orderstrings) { # In the HTML interface, by default, we limit the returned results, # which speeds up quite a few searches where people are really only looking # for the top results. -if ($format->{'extension'} eq 'html' && !defined $cgi->param('limit')) { +if ($format->{'extension'} eq 'html' && !defined $params->param('limit')) { $params->param('limit', Bugzilla->params->{'default_search_limit'}); $vars->{'default_limited'} = 1; } -- cgit v1.2.3-24-g4f1b From a19a89b719051f356cf16060b35be9bc9aa6cb01 Mon Sep 17 00:00:00 2001 From: Max Kanat-Alexander Date: Tue, 16 Aug 2011 17:42:54 -0700 Subject: Bug 655472: Print out localconfig as UTF-8 so we don't mangle UTF-8 comments. r=LpSolit, a=LpSolit --- Bugzilla/Install/Localconfig.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Bugzilla/Install/Localconfig.pm b/Bugzilla/Install/Localconfig.pm index 3ce12207e..1ee7aca67 100644 --- a/Bugzilla/Install/Localconfig.pm +++ b/Bugzilla/Install/Localconfig.pm @@ -245,7 +245,8 @@ sub update_localconfig { # Move any custom or old variables into a separate file. if (scalar @old_vars) { my $filename_old = "$filename.old"; - open(my $old_file, ">>$filename_old") || die "$filename_old: $!"; + open(my $old_file, ">>:utf8", $filename_old) + or die "$filename_old: $!"; local $Data::Dumper::Purity = 1; foreach my $var (@old_vars) { print $old_file Data::Dumper->Dump([$localconfig->{$var}], @@ -259,7 +260,7 @@ sub update_localconfig { } # Re-write localconfig - open(my $fh, ">$filename") || die "$filename: $!"; + open(my $fh, ">:utf8", $filename) or die "$filename: $!"; foreach my $var (LOCALCONFIG_VARS) { my $name = $var->{name}; my $desc = install_string("localconfig_$name", { root => ROOT_USER }); -- cgit v1.2.3-24-g4f1b From 0df89d6d2a4c50dbadd2e579e53bb5e685b923f2 Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Wed, 17 Aug 2011 13:01:16 +0200 Subject: Bug 298268: editparams.cgi should accept urlbase, sslbase, etc.. with or without a trailing slash r=dkl a=LpSolit --- editparams.cgi | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/editparams.cgi b/editparams.cgi index 6affd324c..28aac9602 100755 --- a/editparams.cgi +++ b/editparams.cgi @@ -100,6 +100,11 @@ if ($action eq 'save' && $current_module) { # assume single linefeed is an empty string $value =~ s/^\n$//; } + # Stop complaining if the URL has no trailing slash. + # XXX - This hack can go away once bug 303662 is implemented. + if ($name =~ /(? Date: Wed, 17 Aug 2011 14:54:44 +0200 Subject: Bug 677522: IssueEmailChangeToken() should get the old login name from the user object r=timello a=LpSolit --- Bugzilla/Token.pm | 8 ++++---- userprefs.cgi | 7 ++----- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/Bugzilla/Token.pm b/Bugzilla/Token.pm index c339c5984..86220aa29 100644 --- a/Bugzilla/Token.pm +++ b/Bugzilla/Token.pm @@ -92,8 +92,9 @@ sub issue_new_user_account_token { } sub IssueEmailChangeToken { - my ($user, $old_email, $new_email) = @_; + my ($user, $new_email) = @_; my $email_suffix = Bugzilla->params->{'emailsuffix'}; + my $old_email = $user->login; my ($token, $token_ts) = _create_token($user->id, 'emailold', $old_email . ":" . $new_email); @@ -447,7 +448,7 @@ Bugzilla::Token - Provides different routines to manage tokens. use Bugzilla::Token; Bugzilla::Token::issue_new_user_account_token($login_name); - Bugzilla::Token::IssueEmailChangeToken($user, $old_email, $new_email); + Bugzilla::Token::IssueEmailChangeToken($user, $new_email); Bugzilla::Token::IssuePasswordToken($user); Bugzilla::Token::DeletePasswordTokens($user_id, $reason); Bugzilla::Token::Cancel($token, $cancelaction, $vars); @@ -478,7 +479,7 @@ Bugzilla::Token - Provides different routines to manage tokens. Returns: Nothing. It throws an error if the same user made the same request in the last few minutes. -=item C +=item C Description: Sends two distinct tokens per email to the old and new email addresses to confirm the email address change for the given @@ -486,7 +487,6 @@ Bugzilla::Token - Provides different routines to manage tokens. Params: $user - User object of the user requesting a new email address. - $old_email - The current (old) email address of the user. $new_email - The new email address of the user. Returns: Nothing. diff --git a/userprefs.cgi b/userprefs.cgi index f411326a2..94fe1def2 100755 --- a/userprefs.cgi +++ b/userprefs.cgi @@ -84,8 +84,6 @@ sub SaveAccount { my $oldpassword = $cgi->param('old_password'); my $pwd1 = $cgi->param('new_password1'); my $pwd2 = $cgi->param('new_password2'); - - my $old_login_name = $user->login; my $new_login_name = trim($cgi->param('new_login_name')); if ($user->authorizer->can_change_password @@ -119,7 +117,7 @@ sub SaveAccount { && Bugzilla->params->{"allowemailchange"} && $new_login_name) { - if ($old_login_name ne $new_login_name) { + if ($user->login ne $new_login_name) { $oldpassword || ThrowUserError("old_password_required"); # Block multiple email changes for the same user. @@ -133,8 +131,7 @@ sub SaveAccount { is_available_username($new_login_name) || ThrowUserError("account_exists", {email => $new_login_name}); - Bugzilla::Token::IssueEmailChangeToken($user, $old_login_name, - $new_login_name); + Bugzilla::Token::IssueEmailChangeToken($user, $new_login_name); $vars->{'email_changes_saved'} = 1; } -- cgit v1.2.3-24-g4f1b