From 6d02055deb5a8bbeff15459f150e129bbf725eab Mon Sep 17 00:00:00 2001 From: Matt Selsky Date: Mon, 26 Dec 2011 13:48:18 +0100 Subject: Bug 399080: Remove the 'usebugaliases' parameter (turned on permanently) r/a=LpSolit --- Bugzilla/Bug.pm | 11 +++--- Bugzilla/Config/BugFields.pm | 6 ---- Bugzilla/WebService/Bug.pm | 42 ++++------------------ colchange.cgi | 1 - process_bug.cgi | 2 +- .../en/default/admin/params/bugfields.html.tmpl | 3 -- template/en/default/bug/create/create.html.tmpl | 7 ++-- template/en/default/bug/edit.html.tmpl | 10 ++---- template/en/default/bug/show-multiple.html.tmpl | 4 +-- template/en/default/global/user-error.html.tmpl | 4 +-- template/en/default/pages/fields.html.tmpl | 1 - template/en/default/pages/quicksearch.html.tmpl | 9 ++--- xt/lib/Bugzilla/Test/Search.pm | 1 - 13 files changed, 23 insertions(+), 78 deletions(-) diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 5e54318fb..362fa90d7 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -337,12 +337,11 @@ sub new { # If we get something that looks like a word (not a number), # make it the "name" param. if (!defined $param || (!ref($param) && $param !~ /^\d+$/)) { - # But only if aliases are enabled. - if (Bugzilla->params->{'usebugaliases'} && $param) { + if ($param) { $param = { name => $param }; } else { - # Aliases are off, and we got something that's not a number. + # We got something that's not a number. my $error_self = {}; bless $error_self, $class; $error_self->{'bug_id'} = $param; @@ -611,8 +610,7 @@ sub possible_duplicates { # C - B The platform the bug was found against. # C - B The version of the product the bug was found in. # -# C - An alias for this bug. Will be ignored if C -# is off. +# C - An alias for this bug. # C - When this bug is expected to be fixed. # C - A string. # C - The initial status of the bug, a string. @@ -1202,7 +1200,7 @@ sub _send_bugmail { sub _check_alias { my ($invocant, $alias) = @_; $alias = trim($alias); - return undef if (!Bugzilla->params->{'usebugaliases'} || !$alias); + return undef if (!$alias); # Make sure the alias isn't too long. if (length($alias) > 20) { @@ -3696,7 +3694,6 @@ sub choices { # the ID of the bug if it exists or the undefined value if it doesn't. sub bug_alias_to_id { my ($alias) = @_; - return undef unless Bugzilla->params->{"usebugaliases"}; my $dbh = Bugzilla->dbh; trick_taint($alias); return $dbh->selectrow_array( diff --git a/Bugzilla/Config/BugFields.pm b/Bugzilla/Config/BugFields.pm index d0de9dac6..651bc9e65 100644 --- a/Bugzilla/Config/BugFields.pm +++ b/Bugzilla/Config/BugFields.pm @@ -71,12 +71,6 @@ sub get_param_list { default => 0 }, - { - name => 'usebugaliases', - type => 'b', - default => 0 - }, - { name => 'use_see_also', type => 'b', diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm index b0f8c0a0c..9a67f2304 100644 --- a/Bugzilla/WebService/Bug.pm +++ b/Bugzilla/WebService/Bug.pm @@ -383,14 +383,7 @@ sub history { # alias is returned in case users passes a mixture of ids and aliases # then they get to know which bug activity relates to which value # they passed - if (Bugzilla->params->{'usebugaliases'}) { - $item{alias} = $self->type('string', $bug->alias); - } - else { - # For API reasons, we always want the value to appear, we just - # don't want it to have a value if aliases are turned off. - $item{alias} = undef; - } + $item{alias} = $self->type('string', $bug->alias); push(@return, \%item); } @@ -527,14 +520,7 @@ sub update { # alias is returned in case users pass a mixture of ids and aliases, # so that they can know which set of changes relates to which value # they passed. - if (Bugzilla->params->{'usebugaliases'}) { - $hash{alias} = $self->type('string', $bug->alias); - } - else { - # For API reasons, we always want the alias field to appear, we - # just don't want it to have a value if aliases are turned off. - $hash{alias} = $self->type('string', ''); - } + $hash{alias} = $self->type('string', $bug->alias); my %changes = %{ $all_changes{$bug->id} }; foreach my $field (keys %changes) { @@ -1573,10 +1559,6 @@ from the Bugzilla database to fetch. If it contains any non-numeric characters, it is considered to be a bug alias instead, and the bug with that alias will be loaded. -Note that it's possible for aliases to be disabled in Bugzilla, in which -case you will be told that you have specified an invalid bug_id if you -try to specify an alias. (It will be error 100.) - =item C B C Normally, if you request any inaccessible or invalid bug ids, @@ -1825,8 +1807,7 @@ invalid bug error. =item 100 (Invalid Bug Alias) -If you specified an alias and either: (a) the Bugzilla you're querying -doesn't support aliases or (b) there is no bug with that alias. +If you specified an alias and there is no bug with that alias. =item 101 (Invalid Bug ID) @@ -1913,10 +1894,6 @@ from the Bugzilla database to fetch. If it contains any non-numeric characters, it is considered to be a bug alias instead, and the data bug with that alias will be loaded. -Note that it's possible for aliases to be disabled in Bugzilla, in which -case you will be told that you have specified an invalid bug_id if you -try to specify an alias. (It will be error 100.) - =back =item B @@ -1932,8 +1909,7 @@ C The numeric id of the bug. =item alias -C The alias of this bug. If there is no alias or aliases are -disabled in this Bugzilla, this will be undef. +C The alias of this bug. If there is no alias, this will be undef. =item history @@ -2035,9 +2011,7 @@ most-common database to use with Bugzilla, and MySQL is not case sensitive). =item C -C The unique alias for this bug. Note that you can search -by alias even if the alias field is disabled in this Bugzilla, but -it's likely that there won't be any aliases set on bugs, in that case. +C The unique alias for this bug. =item C @@ -2534,8 +2508,7 @@ C<99999.99>. =item 100 (Invalid Bug Alias) -If you specified an alias and either: (a) the Bugzilla you're querying -doesn't support aliases or (b) there is no bug with that alias. +If you specified an alias and there is no bug with that alias. =item 101 (Invalid Bug ID) @@ -2892,8 +2865,7 @@ C The id of the bug that was updated. =item C -C The alias of the bug that was updated, if aliases are enabled and -this bug has an alias. +C The alias of the bug that was updated, if this bug has an alias. =item C diff --git a/colchange.cgi b/colchange.cgi index c3741f623..81b7d1e16 100755 --- a/colchange.cgi +++ b/colchange.cgi @@ -40,7 +40,6 @@ use Storable qw(dclone); # Maps parameters that control columns to the names of columns. use constant COLUMN_PARAMS => { 'useclassification' => ['classification'], - 'usebugaliases' => ['alias'], 'usetargetmilestone' => ['target_milestone'], 'useqacontact' => ['qa_contact', 'qa_contact_realname'], 'usestatuswhiteboard' => ['status_whiteboard'], diff --git a/process_bug.cgi b/process_bug.cgi index 2d04f73c1..2e054bc29 100755 --- a/process_bug.cgi +++ b/process_bug.cgi @@ -306,7 +306,7 @@ if (defined $cgi->param('newcc') if (defined $cgi->param('id')) { # Since aliases are unique (like bug numbers), they can only be changed # for one bug at a time. - if (Bugzilla->params->{"usebugaliases"} && defined $cgi->param('alias')) { + if (defined $cgi->param('alias')) { $set_all_fields{alias} = $cgi->param('alias'); } } diff --git a/template/en/default/admin/params/bugfields.html.tmpl b/template/en/default/admin/params/bugfields.html.tmpl index 58b08f615..a58fe5a95 100644 --- a/template/en/default/admin/params/bugfields.html.tmpl +++ b/template/en/default/admin/params/bugfields.html.tmpl @@ -34,9 +34,6 @@ usestatuswhiteboard => "Do you wish to use the Status Whiteboard field?", - usebugaliases => "Do you wish to use $terms.bug aliases, which allow you to assign " _ - "$terms.bugs an easy-to-remember name by which you can refer to them?", - use_see_also => "Do you wish to use the See Also field? It allows you refer to" _ " $terms.bugs in other installations. Even if you disable this field," diff --git a/template/en/default/bug/create/create.html.tmpl b/template/en/default/bug/create/create.html.tmpl index ee19ab5d6..616fab888 100644 --- a/template/en/default/bug/create/create.html.tmpl +++ b/template/en/default/bug/create/create.html.tmpl @@ -352,9 +352,8 @@ TUI_hide_default('attachment_text_field');   [%# Calculate the number of rows we can use for flags %] - [% num_rows = 6 + (Param("useqacontact") ? 1 : 0) + - (user.is_timetracker ? 3 : 0) + - (Param("usebugaliases") ? 1 : 0) + [% num_rows = 7 + (Param("useqacontact") ? 1 : 0) + + (user.is_timetracker ? 3 : 0) %] @@ -464,7 +463,6 @@ TUI_hide_default('attachment_text_field'); [% END %] -[% IF Param("usebugaliases") %] [% INCLUDE "bug/field-label.html.tmpl" field = bug_fields.alias editable = 1 @@ -473,7 +471,6 @@ TUI_hide_default('attachment_text_field'); -[% END %] [% INCLUDE "bug/field-label.html.tmpl" diff --git a/template/en/default/bug/edit.html.tmpl b/template/en/default/bug/edit.html.tmpl index 03b713913..7dd1baaff 100644 --- a/template/en/default/bug/edit.html.tmpl +++ b/template/en/default/bug/edit.html.tmpl @@ -186,10 +186,8 @@ [%-# %][% terms.Bug %] [% bug.bug_id FILTER html %] [%-# %] - - [% IF Param("usebugaliases") %] - [% IF bug.alias != "" %] - ([% bug.alias FILTER html %]) - [% END %] + [% IF bug.alias != "" %] + ([% bug.alias FILTER html %]) [% END %] [% bug.short_desc FILTER quoteUrls(bug) %] [% IF bug.check_can_change_field('short_desc', 0, 1) || @@ -201,8 +199,7 @@
- [% IF Param("usebugaliases") %] - + [% IF bug.check_can_change_field('alias', 0, 1) %] - [% END %] [%# *** Summary *** %]
diff --git a/template/en/default/bug/show-multiple.html.tmpl b/template/en/default/bug/show-multiple.html.tmpl index 33dde14a3..854ad5ae7 100644 --- a/template/en/default/bug/show-multiple.html.tmpl +++ b/template/en/default/bug/show-multiple.html.tmpl @@ -65,7 +65,7 @@

[% terms.Bug %] [% bug.bug_id FILTER html %] - [% IF Param("usebugaliases") AND bug.alias AND NOT bug.error %] + [% IF bug.alias AND NOT bug.error %] ( [% bug.alias FILTER html %]) [% END %] @@ -77,7 +77,7 @@

[% IF bug.error == "InvalidBugId" %] '[%+ bug.bug_id FILTER html %]' is not a valid [% terms.bug %] number - [%- IF Param("usebugaliases") %] nor a known [% terms.bug %] alias[% END %]. + nor a known [% terms.bug %] alias. [% ELSIF bug.error == "NotPermitted" %] You are not allowed to view this [% terms.bug %]. [% ELSIF bug.error == "NotFound" %] diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl index fc290eb53..89926bfd5 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -914,9 +914,7 @@ [% END %] [% IF bug_id %] '[% bug_id FILTER html %]' is not a valid [% terms.bug %] number - [% IF Param("usebugaliases") %] - nor an alias to [% terms.abug %] - [% END %]. + nor an alias to [% terms.abug %]. [% ELSE %] [% IF field %] The '[% field_descs.$field FILTER html %]' field diff --git a/template/en/default/pages/fields.html.tmpl b/template/en/default/pages/fields.html.tmpl index 2794e1cc4..c0bf3811d 100644 --- a/template/en/default/pages/fields.html.tmpl +++ b/template/en/default/pages/fields.html.tmpl @@ -220,7 +220,6 @@ [% NEXT IF field == 'status_whiteboard' AND !Param('usestatuswhiteboard') %] [% NEXT IF field == 'target_milestone' AND !Param('usetargetmilestone') %] - [% NEXT IF field == 'alias' AND !Param('usebugaliases') %] [%# For now we don't have help for attachment fields and so on. %] [% NEXT IF field.match('\.') %] diff --git a/template/en/default/pages/quicksearch.html.tmpl b/template/en/default/pages/quicksearch.html.tmpl index e6398eade..0e6a9e511 100644 --- a/template/en/default/pages/quicksearch.html.tmpl +++ b/template/en/default/pages/quicksearch.html.tmpl @@ -46,17 +46,14 @@ [%+ field_descs.product FILTER html %], [%+ field_descs.component FILTER html %], [%+ IF use_keywords %][%+ field_descs.keywords FILTER html %],[% END %] - [%+ IF Param('usebugaliases') %][% field_descs.alias FILTER html %],[% END %] + [%+ field_descs.alias FILTER html %], [%+ field_descs.short_desc FILTER html %], [%+ IF Param('usestatuswhiteboard') %][% field_descs.status_whiteboard FILTER html %],[% END %] and [% field_descs.longdesc FILTER html %] fields for your word or words.
  • Typing just a number in the search box will take - you directly to the [% terms.bug %] with that ID. - [% IF Param('usebugaliases') %] - Also, just typing the alias of [% terms.abug %] - will take you to that [% terms.bug %]. - [% END %] + you directly to the [% terms.bug %] with that ID. Also, just typing the + alias of [% terms.abug %] will take you to that [% terms.bug %].
  • Adding more terms narrows down the search, it does not diff --git a/xt/lib/Bugzilla/Test/Search.pm b/xt/lib/Bugzilla/Test/Search.pm index f18d3e4ca..73b7c56fb 100644 --- a/xt/lib/Bugzilla/Test/Search.pm +++ b/xt/lib/Bugzilla/Test/Search.pm @@ -887,7 +887,6 @@ sub run { my $params = Bugzilla->params; local $params->{'useclassification'} = 1; local $params->{'useqacontact'} = 1; - local $params->{'usebugaliases'} = 1; local $params->{'usetargetmilestone'} = 1; local $params->{'mail_delivery_method'} = 'None'; local $params->{'timetrackinggroup'} = $everybody->name; -- cgit v1.2.3-24-g4f1b