Commit a8dbdd44 authored by Per Cederqvist's avatar Per Cederqvist

Imported Bugzilla 4.2.5.

parent 71c08104
This is a Bazaar control directory.
Do not change any files in this directory.
See http://bazaar.canonical.com/ for more information about Bazaar.
See http://bazaar-vcs.org/ for more information about Bazaar.
No preview for this file type
......@@ -1368,7 +1368,7 @@ sub _check_bug_status {
}
# Check if a comment is required for this change.
if ($new_status->comment_required_on_change_from($old_status) && !$comment)
if ($new_status->comment_required_on_change_from($old_status) && !$comment->{'thetext'})
{
ThrowUserError('comment_required', { old => $old_status,
new => $new_status });
......@@ -1462,8 +1462,12 @@ sub _check_component {
$name || ThrowUserError("require_component");
my $product = blessed($invocant) ? $invocant->product_obj
: $params->{product};
my $obj = Bugzilla::Component->check({ product => $product, name => $name });
return $obj;
my $old_comp = blessed($invocant) ? $invocant->component : '';
my $object = Bugzilla::Component->check({ product => $product, name => $name });
if ($object->name ne $old_comp && !$object->is_active) {
ThrowUserError('value_inactive', { class => ref($object), value => $name });
}
return $object;
}
sub _check_creation_ts {
......@@ -1905,10 +1909,14 @@ sub _check_target_milestone {
my ($invocant, $target, undef, $params) = @_;
my $product = blessed($invocant) ? $invocant->product_obj
: $params->{product};
my $old_target = blessed($invocant) ? $invocant->target_milestone : '';
$target = trim($target);
$target = $product->default_milestone if !defined $target;
my $object = Bugzilla::Milestone->check(
{ product => $product, name => $target });
if ($old_target && $object->name ne $old_target && !$object->is_active) {
ThrowUserError('value_inactive', { class => ref($object), value => $target });
}
return $object->name;
}
......@@ -1931,8 +1939,11 @@ sub _check_version {
$version = trim($version);
my $product = blessed($invocant) ? $invocant->product_obj
: $params->{product};
my $object =
Bugzilla::Version->check({ product => $product, name => $version });
my $old_vers = blessed($invocant) ? $invocant->version : '';
my $object = Bugzilla::Version->check({ product => $product, name => $version });
if ($object->name ne $old_vers && !$object->is_active) {
ThrowUserError('value_inactive', { class => ref($object), value => $version });
}
return $object->name;
}
......@@ -2467,9 +2478,9 @@ sub _set_product {
milestone => $milestone_ok ? $self->target_milestone
: $product->default_milestone
};
$vars{components} = [map { $_->name } @{$product->components}];
$vars{milestones} = [map { $_->name } @{$product->milestones}];
$vars{versions} = [map { $_->name } @{$product->versions}];
$vars{components} = [map { $_->name } grep($_->is_active, @{$product->components})];
$vars{milestones} = [map { $_->name } grep($_->is_active, @{$product->milestones})];
$vars{versions} = [map { $_->name } grep($_->is_active, @{$product->versions})];
}
if (!$verified) {
......@@ -3639,9 +3650,13 @@ sub bug_alias_to_id {
# Subroutines
#####################################################################
# Represents which fields from the bugs table are handled by process_bug.cgi.
# Returns a list of currently active and editable bug fields,
# including multi-select fields.
sub editable_bug_fields {
my @fields = Bugzilla->dbh->bz_table_columns('bugs');
# Add multi-select fields
push(@fields, map { $_->name } @{Bugzilla->fields({obsolete => 0,
type => FIELD_TYPE_MULTI_SELECT})});
# Obsolete custom fields are not editable.
my @obsolete_fields = @{ Bugzilla->fields({obsolete => 1, custom => 1}) };
@obsolete_fields = map { $_->name } @obsolete_fields;
......@@ -3649,7 +3664,7 @@ sub editable_bug_fields {
"lastdiffed", @obsolete_fields)
{
my $location = firstidx { $_ eq $remove } @fields;
# Custom multi-select fields are not stored in the bugs table.
# Ensure field exists before attempting to remove it.
splice(@fields, $location, 1) if ($location > -1);
}
# Sorted because the old @::log_columns variable, which this replaces,
......
......@@ -80,6 +80,14 @@ sub get_param_list {
checker => \&check_group
},
{
name => 'debug_group',
type => 's',
choices => \&_get_all_group_names,
default => 'admin',
checker => \&check_group
},
{
name => 'usevisibilitygroups',
type => 'b',
......
......@@ -34,6 +34,12 @@ package Bugzilla::Config::MTA;
use strict;
use Bugzilla::Config::Common;
# Return::Value 1.666002 pollutes the error log with warnings about this
# deprecated module. We have to set NO_CLUCK = 1 before loading Email::Send
# to disable these warnings.
BEGIN {
$Return::Value::NO_CLUCK = 1;
}
use Email::Send;
our $sortkey = 1200;
......
......@@ -202,7 +202,7 @@ use Memoize;
# CONSTANTS
#
# Bugzilla version
use constant BUGZILLA_VERSION => "4.2.4";
use constant BUGZILLA_VERSION => "4.2.5";
# Location of the remote and local XML files to track new releases.
use constant REMOTE_FILE => 'http://updates.bugzilla.org/bugzilla-update.xml';
......
......@@ -32,6 +32,13 @@ use List::Util qw(max);
use Safe;
use Term::ANSIColor;
# Return::Value 1.666002 pollutes the error log with warnings about this
# deprecated module. We have to set NO_CLUCK = 1 before loading Email::Send
# in have_vers() to disable these warnings.
BEGIN {
$Return::Value::NO_CLUCK = 1;
}
use base qw(Exporter);
our @EXPORT = qw(
REQUIRED_MODULES
......
......@@ -48,6 +48,12 @@ use Encode qw(encode);
use Encode::MIME::Header;
use Email::Address;
use Email::MIME;
# Return::Value 1.666002 pollutes the error log with warnings about this
# deprecated module. We have to set NO_CLUCK = 1 before loading Email::Send
# to disable these warnings.
BEGIN {
$Return::Value::NO_CLUCK = 1;
}
use Email::Send;
sub MessageToMTA {
......
......@@ -2269,7 +2269,7 @@ sub _user_nonchanged {
my $table = $first_join->{table};
my $columns = "bug_id";
$columns .= ",isprivate" if @{ $first_join->{extra} };
my $new_table = "SELECT $columns FROM $table AS $as $join_sql";
my $new_table = "SELECT DISTINCT $columns FROM $table AS $as $join_sql";
$first_join->{table} = "($new_table)";
# We always want to LEFT JOIN the generated table.
delete $first_join->{join};
......
......@@ -140,6 +140,7 @@ sub get_format {
return
{
'template' => $template,
'format' => $format,
'extension' => $ctype,
'ctype' => Bugzilla::Constants::contenttypes->{$ctype}
};
......@@ -971,7 +972,7 @@ sub create {
}
return \@optional;
},
'default_authorizer' => new Bugzilla::Auth(),
'default_authorizer' => sub { return Bugzilla::Auth->new() },
},
};
......
......@@ -2201,6 +2201,35 @@ Returns a hashref with tag IDs as key, and a hashref with tag 'id',
=back
=head2 Saved Recent Bug Lists
=over
=item C<recent_searches>
Returns an arrayref of L<Bugzilla::Search::Recent> objects
containing the user's recent searches.
=item C<recent_search_containing(bug_id)>
Returns a L<Bugzilla::Search::Recent> object that contains the most recent
search by the user for the specified bug id. Retuns undef if no match is found.
=item C<recent_search_for(bug)>
Returns a L<Bugzilla::Search::Recent> object that contains a search by the
user. Uses the list_id of the current loaded page, or the referrer page, and
the bug id if that fails. Finally it will check the BUGLIST cookie, and create
an object based on that, or undef if it does not exist.
=item C<save_last_search>
Saves the users most recent search in the database if logged in, or in the
BUGLIST cookie if not logged in. Parameters are bug_ids, order, vars and
list_id.
=back
=head2 Account Lockout
=over
......
......@@ -2392,7 +2392,9 @@ these bugs.
=item C<data>
B<Required> C<base64> The content of the attachment.
B<Required> C<base64> or C<string> The content of the attachment.
If the content of the attachment is not ASCII text, you must encode
it in base64 and declare it as the C<base64> type.
=item C<file_name>
......
......@@ -786,7 +786,10 @@ $params->delete('limit') if $vars->{'default_limited'};
# Query Execution
################################################################################
if ($cgi->param('debug')) {
if ($cgi->param('debug')
&& Bugzilla->params->{debug_group}
&& $user->in_group(Bugzilla->params->{debug_group})
) {
$vars->{'debug'} = 1;
$vars->{'query'} = $query;
# Explains are limited to admins because you could use them to figure
......
......@@ -287,24 +287,32 @@ if ($bug_id) {
=head2 Retrieving Product Information
Call C<Product.get_product> with the name of the product you want to know more
of.
Call C<Product.get> with the name of the product you want to know more of.
The call will return a C<Bugzilla::Product> object.
=cut
if ($product_name) {
$soapresult = $proxy->call('Product.get_product', $product_name);
$soapresult = $proxy->call('Product.get', {'names' => [$product_name]});
_die_on_fault($soapresult);
$result = $soapresult->result;
if (ref($result) eq 'HASH') {
foreach (keys(%$result)) {
print "$_: $$result{$_}\n";
$result = $soapresult->result()->{'products'}->[0];
# Iterate all entries, the values may be scalars or array refs with hash refs.
foreach my $key (sort(keys %$result)) {
my $value = $result->{$key};
if (ref($value)) {
my $counter = 0;
foreach my $hash (@$value) {
while (my ($innerKey, $innerValue) = each %$hash) {
print "$key.$counter.$innerKey: $innerValue\n";
}
++$counter;
}
}
else {
print "$result\n";
}
else {
print "$key: $value\n"
}
}
}
......
......@@ -6,7 +6,7 @@
<!ENTITY min-date-format-ver "2.21">
<!ENTITY min-datetime-ver "0.28">
<!ENTITY min-datetime-timezone-ver "0.71">
<!ENTITY min-dbi-ver "1.614">
<!ENTITY min-dbi-ver "1.41">
<!ENTITY min-template-ver "2.22">
<!ENTITY min-email-send-ver "2.00">
<!ENTITY min-email-mime-ver "1.904">
......@@ -29,7 +29,7 @@
<!ENTITY min-json-rpc-ver "any">
<!ENTITY min-json-xs-ver "2.0">
<!ENTITY min-test-taint-ver "any">
<!ENTITY min-html-parser-ver "3.67">
<!ENTITY min-html-parser-ver "3.40">
<!ENTITY min-html-scrubber-ver "any">
<!ENTITY min-encode-ver "2.21">
<!ENTITY min-encode-detect-ver "any">
......
......@@ -2,7 +2,7 @@
<HTML
><HEAD
><TITLE
>The Bugzilla Guide - 4.2.4
>The Bugzilla Guide - 4.2.5
Release</TITLE
><META
NAME="GENERATOR"
......@@ -43,7 +43,7 @@ CLASS="TITLEPAGE"
CLASS="title"
><A
NAME="AEN2"
>The Bugzilla Guide - 4.2.4
>The Bugzilla Guide - 4.2.5
Release</A
></H1
><H3
......@@ -51,7 +51,7 @@ CLASS="corpauthor"
>The Bugzilla Team</H3
><P
CLASS="pubdate"
>2012-11-13<BR></P
>2013-02-19<BR></P
><DIV
><DIV
CLASS="abstract"
......@@ -614,7 +614,7 @@ NAME="copyright"
>1.1. Copyright Information</A
></H2
><P
>This document is copyright (c) 2000-2012 by the various
>This document is copyright (c) 2000-2013 by the various
Bugzilla contributors who wrote it.</P
><A
NAME="AEN26"
......@@ -683,7 +683,7 @@ NAME="newversions"
>1.3. New Versions</A
></H2
><P
>&#13; This is the 4.2.4 version of The Bugzilla Guide. It is so named
>&#13; This is the 4.2.5 version of The Bugzilla Guide. It is so named
to match the current version of Bugzilla.
This version of the guide, like its associated Bugzilla version, is a
development version.
......@@ -1847,7 +1847,7 @@ TYPE="1"
></LI
><LI
><P
>&#13; DBI (1.614)
>&#13; DBI (1.41)
</P
></LI
><LI
......@@ -1983,7 +1983,7 @@ TYPE="1"
><LI
><P
>&#13; HTML::Parser
(3.67) for More HTML in Product/Group Descriptions
(3.40) for More HTML in Product/Group Descriptions
</P
></LI
><LI
......
......@@ -7,11 +7,11 @@
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="The Bugzilla Guide - 4.2.4
TITLE="The Bugzilla Guide - 4.2.5
Release"
HREF="index.html"><LINK
REL="PREVIOUS"
TITLE="The Bugzilla Guide - 4.2.4
TITLE="The Bugzilla Guide - 4.2.5
Release"
HREF="index.html"><LINK
REL="NEXT"
......@@ -36,7 +36,7 @@ CELLSPACING="0"
><TH
COLSPAN="3"
ALIGN="center"
>The Bugzilla Guide - 4.2.4
>The Bugzilla Guide - 4.2.5
Release</TH
></TR
><TR
......@@ -154,7 +154,7 @@ ACCESSKEY="N"
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>The Bugzilla Guide - 4.2.4
>The Bugzilla Guide - 4.2.5
Release</TD
><TD
WIDTH="34%"
......
......@@ -7,7 +7,7 @@
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="The Bugzilla Guide - 4.2.4
TITLE="The Bugzilla Guide - 4.2.5
Release"
HREF="index.html"><LINK
REL="PREVIOUS"
......@@ -35,7 +35,7 @@ CELLSPACING="0"
><TH
COLSPAN="3"
ALIGN="center"
>The Bugzilla Guide - 4.2.4
>The Bugzilla Guide - 4.2.5
Release</TH
></TR
><TR
......
......@@ -20,6 +20,7 @@ Bugzilla::User</title>
<ul class='indexList indexList2'>
<li class='indexItem indexItem2'><a href='#Constructors'>Constructors</a>
<li class='indexItem indexItem2'><a href='#Saved_and_Shared_Queries'>Saved and Shared Queries</a>
<li class='indexItem indexItem2'><a href='#Saved_Recent_Bug_Lists'>Saved Recent Bug Lists</a>
<li class='indexItem indexItem2'><a href='#Account_Lockout'>Account Lockout</a>
<li class='indexItem indexItem2'><a href='#Other_Methods'>Other Methods</a>
</ul>
......@@ -162,6 +163,40 @@ name="Saved_and_Shared_Queries"
</dd>
</dl>
<h2><a class='u' href='#___top' title='click to go to top of document'
name="Saved_Recent_Bug_Lists"
>Saved Recent Bug Lists</a></h2>
<dl>
<dt><a name="recent_searches"
><code class="code">recent_searches</code></a></dt>
<dd>
<p>Returns an arrayref of <a href="../Bugzilla/Search/Recent.html" class="podlinkpod"
>Bugzilla::Search::Recent</a> objects containing the user&#39;s recent searches.</p>
<dt><a name="recent_search_containing(bug_id)"
><code class="code">recent_search_containing(bug_id)</code></a></dt>
<dd>
<p>Returns a <a href="../Bugzilla/Search/Recent.html" class="podlinkpod"
>Bugzilla::Search::Recent</a> object that contains the most recent search by the user for the specified bug id. Retuns undef if no match is found.</p>
<dt><a name="recent_search_for(bug)"
><code class="code">recent_search_for(bug)</code></a></dt>
<dd>
<p>Returns a <a href="../Bugzilla/Search/Recent.html" class="podlinkpod"
>Bugzilla::Search::Recent</a> object that contains a search by the user. Uses the list_id of the current loaded page, or the referrer page, and the bug id if that fails. Finally it will check the BUGLIST cookie, and create an object based on that, or undef if it does not exist.</p>
<dt><a name="save_last_search"
><code class="code">save_last_search</code></a></dt>
<dd>
<p>Saves the users most recent search in the database if logged in, or in the BUGLIST cookie if not logged in. Parameters are bug_ids, order, vars and list_id.</p>
</dd>
</dl>
<h2><a class='u' href='#___top' title='click to go to top of document'
name="Account_Lockout"
>Account Lockout</a></h2>
......
......@@ -1733,7 +1733,7 @@ name="add_attachment"
><code class="code">data</code></a></dt>
<dd>
<p><b>Required</b> <code class="code">base64</code> The content of the attachment.</p>
<p><b>Required</b> <code class="code">base64</code> or <code class="code">string</code> The content of the attachment. If the content of the attachment is not ASCII text, you must encode it in base64 and declare it as the <code class="code">base64</code> type.</p>
<dt><a name="file_name"
><code class="code">file_name</code></a></dt>
......
......@@ -230,7 +230,7 @@ The call will return a <code class="code">Bugzilla::Bug</code> object.</p>
name="Retrieving_Product_Information"
>Retrieving Product Information</a></h2>
<p>Call <code class="code">Product.get_product</code> with the name of the product you want to know more of.
<p>Call <code class="code">Product.get</code> with the name of the product you want to know more of.
The call will return a <code class="code">Bugzilla::Product</code> object.</p>
<h2><a class='u' href='#___top' title='click to go to top of document'
......
......@@ -2,13 +2,13 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Bugzilla 4.2.4 API Documentation</title>
<title>Bugzilla 4.2.5 API Documentation</title>
<link rel="stylesheet" title="style" type="text/css" href="./../../../style.css" media="all" >
</head>
<body class="contentspage">
<h1>Bugzilla 4.2.4 API Documentation</h1>
<h1>Bugzilla 4.2.5 API Documentation</h1>
<dl class='superindex'>
<dt><a name="Extensions">Extensions</a></dt>
<dd>
......
......@@ -7,7 +7,7 @@
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="The Bugzilla Guide - 4.2.4
TITLE="The Bugzilla Guide - 4.2.5
Release"
HREF="index.html"><LINK
REL="UP"
......@@ -38,7 +38,7 @@ CELLSPACING="0"
><TH
COLSPAN="3"
ALIGN="center"
>The Bugzilla Guide - 4.2.4
>The Bugzilla Guide - 4.2.5
Release</TH
></TR
><TR
......
......@@ -7,7 +7,7 @@
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="The Bugzilla Guide - 4.2.4
TITLE="The Bugzilla Guide - 4.2.5
Release"
HREF="index.html"><LINK
REL="UP"
......@@ -38,7 +38,7 @@ CELLSPACING="0"
><TH
COLSPAN="3"
ALIGN="center"
>The Bugzilla Guide - 4.2.4
>The Bugzilla Guide - 4.2.5
Release</TH
></TR
><TR
......
......@@ -7,7 +7,7 @@
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="The Bugzilla Guide - 4.2.4
TITLE="The Bugzilla Guide - 4.2.5
Release"
HREF="index.html"><LINK
REL="UP"
......@@ -38,7 +38,7 @@ CELLSPACING="0"
><TH
COLSPAN="3"
ALIGN="center"
>The Bugzilla Guide - 4.2.4
>The Bugzilla Guide - 4.2.5
Release</TH
></TR
><TR
......
......@@ -7,7 +7,7 @@
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="The Bugzilla Guide - 4.2.4
TITLE="The Bugzilla Guide - 4.2.5
Release"
HREF="index.html"><LINK
REL="UP"
......@@ -38,7 +38,7 @@ CELLSPACING="0"
><TH
COLSPAN="3"
ALIGN="center"
>The Bugzilla Guide - 4.2.4
>The Bugzilla Guide - 4.2.5
Release</TH
></TR
><TR
......
......@@ -7,7 +7,7 @@
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="The Bugzilla Guide - 4.2.4
TITLE="The Bugzilla Guide - 4.2.5
Release"
HREF="index.html"><LINK
REL="UP"
......@@ -38,7 +38,7 @@ CELLSPACING="0"
><TH
COLSPAN="3"
ALIGN="center"
>The Bugzilla Guide - 4.2.4
>The Bugzilla Guide - 4.2.5
Release</TH
></TR
><TR
......