Commit e77dae16 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Imported Bugzilla 3.3.4.

parent 019dc05d
/PatchReader.pm/1.6/Sun Jun 29 17:35:28 2008//TBUGZILLA-3_3_3
/PatchReader.pm/1.6/Sun Jun 29 17:35:28 2008//TBUGZILLA-3_3_4
D
/Login.pm/1.1/Fri May 12 02:41:05 2006//TBUGZILLA-3_3_3
/Verify.pm/1.7/Wed May 23 18:05:49 2007//TBUGZILLA-3_3_3
/Login.pm/1.1/Fri May 12 02:41:05 2006//TBUGZILLA-3_3_4
/Verify.pm/1.7/Wed May 23 18:05:49 2007//TBUGZILLA-3_3_4
D/Login////
D/Persist////
D/Verify////
NBUGZILLA-3_3_3
NBUGZILLA-3_3_4
/CGI.pm/1.12/Sat Oct 4 20:03:15 2008//TBUGZILLA-3_3_3
/Cookie.pm/1.5/Wed Jul 5 23:42:47 2006//TBUGZILLA-3_3_3
/Env.pm/1.4/Mon Jul 3 21:42:46 2006//TBUGZILLA-3_3_3
/Stack.pm/1.2/Wed Aug 6 23:38:24 2008//TBUGZILLA-3_3_3
/CGI.pm/1.12/Sat Oct 4 20:03:15 2008//TBUGZILLA-3_3_4
/Cookie.pm/1.5/Wed Jul 5 23:42:47 2006//TBUGZILLA-3_3_4
/Env.pm/1.4/Mon Jul 3 21:42:46 2006//TBUGZILLA-3_3_4
/Stack.pm/1.2/Wed Aug 6 23:38:24 2008//TBUGZILLA-3_3_4
D
/Cookie.pm/1.8/Tue Jan 20 20:09:48 2009//TBUGZILLA-3_3_3
/Cookie.pm/1.9/Sun Mar 1 23:42:52 2009//TBUGZILLA-3_3_4
D
......@@ -161,6 +161,7 @@ sub clear_browser_cookies {
my $cgi = Bugzilla->cgi;
$cgi->remove_cookie('Bugzilla_login');
$cgi->remove_cookie('Bugzilla_logincookie');
$cgi->remove_cookie('sudo');
}
1;
/DB.pm/1.10/Fri Jan 2 09:11:50 2009//TBUGZILLA-3_3_3
/LDAP.pm/1.18/Mon Oct 20 18:35:51 2008//TBUGZILLA-3_3_3
/RADIUS.pm/1.1/Thu Aug 2 22:38:37 2007//TBUGZILLA-3_3_3
/Stack.pm/1.2/Wed Aug 6 23:38:25 2008//TBUGZILLA-3_3_3
/DB.pm/1.10/Fri Jan 2 09:11:50 2009//TBUGZILLA-3_3_4
/LDAP.pm/1.18/Mon Oct 20 18:35:51 2008//TBUGZILLA-3_3_4
/RADIUS.pm/1.1/Thu Aug 2 22:38:37 2007//TBUGZILLA-3_3_4
/Stack.pm/1.2/Wed Aug 6 23:38:25 2008//TBUGZILLA-3_3_4
D
/.cvsignore/1.1/Mon Aug 26 22:24:55 2002//TBUGZILLA-3_3_3
/Attachment.pm/1.60/Wed Dec 10 18:32:27 2008//TBUGZILLA-3_3_3
/Auth.pm/1.21/Tue Jan 20 20:09:46 2009//TBUGZILLA-3_3_3
/Bug.pm/1.276/Mon Jan 26 21:59:55 2009//TBUGZILLA-3_3_3
/BugMail.pm/1.124/Thu Jan 1 23:24:38 2009//TBUGZILLA-3_3_3
/CGI.pm/1.43/Mon Feb 2 18:21:36 2009//TBUGZILLA-3_3_3
/Chart.pm/1.17/Fri Aug 8 01:26:35 2008//TBUGZILLA-3_3_3
/Classification.pm/1.14/Sun Jan 4 23:15:28 2009//TBUGZILLA-3_3_3
/Component.pm/1.16/Thu Oct 11 23:07:22 2007//TBUGZILLA-3_3_3
/Config.pm/1.76/Wed Dec 24 19:08:20 2008//TBUGZILLA-3_3_3
/Constants.pm/1.108/Tue Feb 3 10:03:46 2009//TBUGZILLA-3_3_3
/DB.pm/1.123/Thu Jan 29 21:22:21 2009//TBUGZILLA-3_3_3
/Error.pm/1.24/Tue May 27 22:08:59 2008//TBUGZILLA-3_3_3
/Field.pm/1.42/Thu Jan 22 04:08:43 2009//TBUGZILLA-3_3_3
/Flag.pm/1.99/Mon Sep 8 17:13:37 2008//TBUGZILLA-3_3_3
/FlagType.pm/1.39/Wed Sep 17 03:47:36 2008//TBUGZILLA-3_3_3
/Group.pm/1.24/Sun Jan 25 18:49:31 2009//TBUGZILLA-3_3_3
/Hook.pm/1.24/Thu Dec 18 17:18:25 2008//TBUGZILLA-3_3_3
/Install.pm/1.19/Sun Jan 25 18:49:31 2009//TBUGZILLA-3_3_3
/JobQueue.pm/1.1/Wed Dec 24 03:43:38 2008//TBUGZILLA-3_3_3
/Keyword.pm/1.7/Tue Sep 5 19:18:26 2006//TBUGZILLA-3_3_3
/Mailer.pm/1.26/Wed Dec 24 03:43:38 2008//TBUGZILLA-3_3_3
/Milestone.pm/1.12/Fri Jan 18 15:56:54 2008//TBUGZILLA-3_3_3
/Object.pm/1.30/Fri Jan 23 03:27:45 2009//TBUGZILLA-3_3_3
/Product.pm/1.33/Fri Jan 2 13:47:56 2009//TBUGZILLA-3_3_3
/Search.pm/1.171/Sun Jan 25 18:49:31 2009//TBUGZILLA-3_3_3
/Series.pm/1.18/Fri Aug 22 15:33:03 2008//TBUGZILLA-3_3_3
/Status.pm/1.11/Fri Nov 7 11:34:42 2008//TBUGZILLA-3_3_3
/Template.pm/1.99/Mon Feb 2 18:33:59 2009//TBUGZILLA-3_3_3
/Token.pm/1.57/Mon Feb 2 18:33:59 2009//TBUGZILLA-3_3_3
/Update.pm/1.10/Fri May 2 19:14:13 2008//TBUGZILLA-3_3_3
/User.pm/1.178/Sun Jan 25 18:49:31 2009//TBUGZILLA-3_3_3
/Util.pm/1.83/Mon Feb 2 18:21:37 2009//TBUGZILLA-3_3_3
/Version.pm/1.14/Thu Aug 23 21:31:20 2007//TBUGZILLA-3_3_3
/WebService.pm/1.16/Fri Jan 9 07:44:05 2009//TBUGZILLA-3_3_3
/.cvsignore/1.1/Mon Aug 26 22:24:55 2002//TBUGZILLA-3_3_4
/Attachment.pm/1.60/Wed Dec 10 18:32:27 2008//TBUGZILLA-3_3_4
/Auth.pm/1.21/Tue Jan 20 20:09:46 2009//TBUGZILLA-3_3_4
/Bug.pm/1.276/Mon Jan 26 21:59:55 2009//TBUGZILLA-3_3_4
/BugMail.pm/1.124/Thu Jan 1 23:24:38 2009//TBUGZILLA-3_3_4
/CGI.pm/1.43/Mon Feb 2 18:21:36 2009//TBUGZILLA-3_3_4
/Chart.pm/1.17/Fri Aug 8 01:26:35 2008//TBUGZILLA-3_3_4
/Classification.pm/1.14/Sun Jan 4 23:15:28 2009//TBUGZILLA-3_3_4
/Component.pm/1.16/Thu Oct 11 23:07:22 2007//TBUGZILLA-3_3_4
/Config.pm/1.76/Wed Dec 24 19:08:20 2008//TBUGZILLA-3_3_4
/Constants.pm/1.109.2.1/Mon Mar 30 23:37:42 2009//TBUGZILLA-3_3_4
/DB.pm/1.124/Fri Feb 20 14:12:49 2009//TBUGZILLA-3_3_4
/Error.pm/1.24/Tue May 27 22:08:59 2008//TBUGZILLA-3_3_4
/Field.pm/1.43/Sun Feb 8 19:42:21 2009//TBUGZILLA-3_3_4
/Flag.pm/1.100/Sat Feb 14 09:45:44 2009//TBUGZILLA-3_3_4
/FlagType.pm/1.39/Wed Sep 17 03:47:36 2008//TBUGZILLA-3_3_4
/Group.pm/1.24/Sun Jan 25 18:49:31 2009//TBUGZILLA-3_3_4
/Hook.pm/1.24/Thu Dec 18 17:18:25 2008//TBUGZILLA-3_3_4
/Install.pm/1.19/Sun Jan 25 18:49:31 2009//TBUGZILLA-3_3_4
/JobQueue.pm/1.1/Wed Dec 24 03:43:38 2008//TBUGZILLA-3_3_4
/Keyword.pm/1.7/Tue Sep 5 19:18:26 2006//TBUGZILLA-3_3_4
/Mailer.pm/1.27/Sun Feb 22 00:44:25 2009//TBUGZILLA-3_3_4
/Milestone.pm/1.12/Fri Jan 18 15:56:54 2008//TBUGZILLA-3_3_4
/Object.pm/1.30/Fri Jan 23 03:27:45 2009//TBUGZILLA-3_3_4
/Product.pm/1.34/Sun Feb 8 19:42:21 2009//TBUGZILLA-3_3_4
/Search.pm/1.173/Mon Mar 2 20:23:34 2009//TBUGZILLA-3_3_4
/Series.pm/1.18/Fri Aug 22 15:33:03 2008//TBUGZILLA-3_3_4
/Status.pm/1.11/Fri Nov 7 11:34:42 2008//TBUGZILLA-3_3_4
/Template.pm/1.99/Mon Feb 2 18:33:59 2009//TBUGZILLA-3_3_4
/Token.pm/1.58/Mon Feb 9 19:18:59 2009//TBUGZILLA-3_3_4
/Update.pm/1.10/Fri May 2 19:14:13 2008//TBUGZILLA-3_3_4
/User.pm/1.178/Sun Jan 25 18:49:31 2009//TBUGZILLA-3_3_4
/Util.pm/1.86/Fri Mar 6 14:42:04 2009//TBUGZILLA-3_3_4
/Version.pm/1.14/Thu Aug 23 21:31:20 2007//TBUGZILLA-3_3_4
/WebService.pm/1.17/Wed Feb 11 20:23:28 2009//TBUGZILLA-3_3_4
D/Attachment////
D/Auth////
D/Config////
......
NBUGZILLA-3_3_3
NBUGZILLA-3_3_4
......@@ -68,7 +68,7 @@ sub get_param_list {
name => 'maxattachmentsize',
type => 't',
default => '1000',
checker => \&check_numeric
checker => \&check_maxattachmentsize
},
# The maximum size (in bytes) for patches and non-patch attachments.
......
/Admin.pm/1.4/Tue Dec 16 21:22:02 2008//TBUGZILLA-3_3_3
/Attachment.pm/1.6/Mon Feb 2 19:10:33 2009//TBUGZILLA-3_3_3
/Auth.pm/1.3/Thu Aug 2 22:38:39 2007//TBUGZILLA-3_3_3
/BugChange.pm/1.7/Wed Dec 10 18:40:00 2008//TBUGZILLA-3_3_3
/BugFields.pm/1.6/Wed Dec 10 18:43:28 2008//TBUGZILLA-3_3_3
/BugMove.pm/1.1/Wed Oct 12 08:51:53 2005//TBUGZILLA-3_3_3
/Common.pm/1.24/Wed Dec 24 03:43:40 2008//TBUGZILLA-3_3_3
/Core.pm/1.10/Wed Aug 27 23:26:15 2008//TBUGZILLA-3_3_3
/DependencyGraph.pm/1.1/Wed Oct 12 08:51:53 2005//TBUGZILLA-3_3_3
/GroupSecurity.pm/1.8/Mon Aug 7 23:05:00 2006//TBUGZILLA-3_3_3
/LDAP.pm/1.2/Fri Jun 2 11:52:48 2006//TBUGZILLA-3_3_3
/MTA.pm/1.17/Wed Dec 24 03:43:40 2008//TBUGZILLA-3_3_3
/PatchViewer.pm/1.1/Wed Oct 12 08:51:53 2005//TBUGZILLA-3_3_3
/Query.pm/1.6/Mon Jan 26 22:05:59 2009//TBUGZILLA-3_3_3
/RADIUS.pm/1.1/Thu Aug 2 22:38:39 2007//TBUGZILLA-3_3_3
/ShadowDB.pm/1.1/Wed Oct 12 08:51:53 2005//TBUGZILLA-3_3_3
/UserMatch.pm/1.1/Wed Oct 12 08:51:53 2005//TBUGZILLA-3_3_3
/Admin.pm/1.4/Tue Dec 16 21:22:02 2008//TBUGZILLA-3_3_4
/Attachment.pm/1.7/Mon Mar 2 01:21:54 2009//TBUGZILLA-3_3_4
/Auth.pm/1.3/Thu Aug 2 22:38:39 2007//TBUGZILLA-3_3_4
/BugChange.pm/1.7/Wed Dec 10 18:40:00 2008//TBUGZILLA-3_3_4
/BugFields.pm/1.6/Wed Dec 10 18:43:28 2008//TBUGZILLA-3_3_4
/BugMove.pm/1.1/Wed Oct 12 08:51:53 2005//TBUGZILLA-3_3_4
/Common.pm/1.25/Mon Mar 2 01:21:54 2009//TBUGZILLA-3_3_4
/Core.pm/1.10/Wed Aug 27 23:26:15 2008//TBUGZILLA-3_3_4
/DependencyGraph.pm/1.1/Wed Oct 12 08:51:53 2005//TBUGZILLA-3_3_4
/GroupSecurity.pm/1.8/Mon Aug 7 23:05:00 2006//TBUGZILLA-3_3_4
/LDAP.pm/1.2/Fri Jun 2 11:52:48 2006//TBUGZILLA-3_3_4
/MTA.pm/1.17/Wed Dec 24 03:43:40 2008//TBUGZILLA-3_3_4
/PatchViewer.pm/1.1/Wed Oct 12 08:51:53 2005//TBUGZILLA-3_3_4
/Query.pm/1.6/Mon Jan 26 22:05:59 2009//TBUGZILLA-3_3_4
/RADIUS.pm/1.1/Thu Aug 2 22:38:39 2007//TBUGZILLA-3_3_4
/ShadowDB.pm/1.1/Wed Oct 12 08:51:53 2005//TBUGZILLA-3_3_4
/UserMatch.pm/1.1/Wed Oct 12 08:51:53 2005//TBUGZILLA-3_3_4
D
NBUGZILLA-3_3_3
NBUGZILLA-3_3_4
......@@ -50,6 +50,7 @@ use base qw(Exporter);
check_netmask check_user_verify_class check_image_converter
check_mail_delivery_method check_notification check_utf8
check_bug_status check_smtp_auth check_theschwartz_available
check_maxattachmentsize
);
# Checking functions for the various values
......@@ -313,6 +314,24 @@ sub check_mail_delivery_method {
return "";
}
sub check_maxattachmentsize {
my $check = check_numeric(@_);
return $check if $check;
my $size = shift;
my $dbh = Bugzilla->dbh;
if ($dbh->isa('Bugzilla::DB::Mysql')) {
my (undef, $max_packet) = $dbh->selectrow_array(
q{SHOW VARIABLES LIKE 'max\_allowed\_packet'});
my $byte_size = $size * 1024;
if ($max_packet < $byte_size) {
return "You asked for a maxattachmentsize of $byte_size bytes,"
. " but the max_allowed_packet setting in MySQL currently"
. " only allows packets up to $max_packet bytes";
}
}
return "";
}
sub check_notification {
my $option = shift;
my @current_version =
......
......@@ -168,7 +168,7 @@ use File::Basename;
# CONSTANTS
#
# Bugzilla version
use constant BUGZILLA_VERSION => "3.3.3";
use constant BUGZILLA_VERSION => "3.3.4";
# These are unique values that are unlikely to match a string or a number,
# to be used in criteria for match() functions and other things. They start
......
......@@ -52,7 +52,7 @@ use Storable qw(dclone);
use constant BLOB_TYPE => DBI::SQL_BLOB;
use constant ISOLATION_LEVEL => 'REPEATABLE READ';
use constant GROUPBY_REGEXP => '(?:.*\s+AS\s+)?(\w+(\.\w+)?)(?:\s+(ASC|DESC))?$';
use constant GROUPBY_REGEXP => '(?:.*\s+AS\s+|SUBSTRING\()?(\w+(\.\w+)?)(?:\s+(ASC|DESC|FROM\s+.+))?$';
# Set default values for what used to be the enum types. These values
# are no longer stored in localconfig. If we are upgrading from a
......
/Mysql.pm/1.71/Wed Dec 24 03:43:41 2008//TBUGZILLA-3_3_3
/Oracle.pm/1.21/Mon Jan 5 19:52:06 2009//TBUGZILLA-3_3_3
/Pg.pm/1.31/Wed Dec 24 03:43:41 2008//TBUGZILLA-3_3_3
/Schema.pm/1.111/Thu Jan 22 04:08:44 2009//TBUGZILLA-3_3_3
/Mysql.pm/1.72/Mon Mar 2 01:21:55 2009//TBUGZILLA-3_3_4
/Oracle.pm/1.23/Thu Feb 26 20:52:40 2009//TBUGZILLA-3_3_4
/Pg.pm/1.31/Wed Dec 24 03:43:41 2008//TBUGZILLA-3_3_4
/Schema.pm/1.112/Mon Mar 30 23:16:05 2009//TBUGZILLA-3_3_4
D/Schema////
NBUGZILLA-3_3_3
NBUGZILLA-3_3_4
......@@ -44,6 +44,7 @@ package Bugzilla::DB::Mysql;
use strict;
use Bugzilla::Constants;
use Bugzilla::Install::Util qw(install_string);
use Bugzilla::Util;
use Bugzilla::Error;
use Bugzilla::DB::Schema::Mysql;
......@@ -101,20 +102,9 @@ sub new {
}
}
# The "comments" field of the bugs_fulltext table could easily exceed
# MySQL's default max_allowed_packet. Also, MySQL should never have
# a max_allowed_packet smaller than our max_attachment_size. However,
# if we've already set a max_allowed_packet in MySQL bigger than all
# of those, we should keep it.
my (undef, $current_max_allowed) = $self->selectrow_array(
q{SHOW VARIABLES LIKE 'max\_allowed\_packet'});
my $min_max_allowed_packet = MAX_COMMENTS * MAX_COMMENT_LENGTH;
my $max_allowed_packet = max($min_max_allowed_packet,
$current_max_allowed,
# This parameter is not yet defined when the DB
# is being built for the very first time.
Bugzilla->params->{'maxattachmentsize'} || 0);
$self->do("SET SESSION max_allowed_packet = $max_allowed_packet");
# Allow large GROUP_CONCATs (largely for inserting comments
# into bugs_fulltext).
$self->do('SET SESSION group_concat_max_len = 128000000');
return $self;
}
......@@ -291,6 +281,24 @@ sub _bz_get_initial_schema {
sub bz_setup_database {
my ($self) = @_;
# The "comments" field of the bugs_fulltext table could easily exceed
# MySQL's default max_allowed_packet. Also, MySQL should never have
# a max_allowed_packet smaller than our max_attachment_size. So, we
# warn the user here if max_allowed_packet is too small.
my $min_max_allowed = MAX_COMMENTS * MAX_COMMENT_LENGTH;
my (undef, $current_max_allowed) = $self->selectrow_array(
q{SHOW VARIABLES LIKE 'max\_allowed\_packet'});
# This parameter is not yet defined when the DB is being built for
# the very first time. The code below still works properly, however,
# because the default maxattachmentsize is smaller than $min_max_allowed.
my $max_attachment = (Bugzilla->params->{'maxattachmentsize'} || 0) * 1024;
my $needed_max_allowed = max($min_max_allowed, $max_attachment);
if ($current_max_allowed < $needed_max_allowed) {
warn install_string('max_allowed_packet',
{ current => $current_max_allowed,
needed => $needed_max_allowed }) . "\n";
}
# Make sure the installation has InnoDB turned on, or we're going to be
# doing silly things like making foreign keys on MyISAM tables, which is
# hard to fix later. We do this up here because none of the code below
......
......@@ -52,7 +52,7 @@ use base qw(Bugzilla::DB);
use constant EMPTY_STRING => '__BZ_EMPTY_STR__';
use constant ISOLATION_LEVEL => 'READ COMMITTED';
use constant BLOB_TYPE => { ora_type => ORA_BLOB };
use constant GROUPBY_REGEXP => '((CASE\s+WHEN.+END)|(TO_CHAR\(.+\))|(\(SCORE.+\))|(\(MATCH.+\))|(\w+(\.\w+)?))(\s+AS\s+)?(.*)?$';
use constant GROUPBY_REGEXP => '((CASE\s+WHEN.+END)|(SUBSTR.+\))|(TO_CHAR\(.+\))|(\(SCORE.+\))|(\(MATCH.+\))|(\w+(\.\w+)?))(\s+AS\s+)?(.*)?$';
sub new {
my ($class, $user, $pass, $host, $dbname, $port) = @_;
......@@ -149,6 +149,13 @@ sub sql_string_concat {
return 'CONCAT(' . join(', ', @params) . ')';
}
sub sql_string_until {
my ($self, $string, $substring) = @_;
return "SUBSTR($string, 1, "
. $self->sql_position($substring, $string)
. " - 1)";
}
sub sql_to_days {
my ($self, $date) = @_;
......
......@@ -825,6 +825,8 @@ use constant ABSTRACT_SCHEMA => {
INDEXES => [
profiles_login_name_idx => {FIELDS => ['login_name'],
TYPE => 'UNIQUE'},
profiles_extern_id_idx => {FIELDS => ['extern_id'],
TYPE => 'UNIQUE'}
],
},
......
/Mysql.pm/1.20/Mon Mar 24 22:47:25 2008//TBUGZILLA-3_3_3
/Oracle.pm/1.9/Mon Jan 5 19:52:08 2009//TBUGZILLA-3_3_3
/Pg.pm/1.15/Tue Dec 11 02:26:49 2007//TBUGZILLA-3_3_3
/Mysql.pm/1.20/Mon Mar 24 22:47:25 2008//TBUGZILLA-3_3_4
/Oracle.pm/1.9/Mon Jan 5 19:52:08 2009//TBUGZILLA-3_3_4
/Pg.pm/1.15/Tue Dec 11 02:26:49 2007//TBUGZILLA-3_3_4
D
......@@ -158,7 +158,7 @@ use constant DEFAULT_FIELDS => (
{name => 'classification', desc => 'Classification', in_new_bugmail => 1,
buglist => 1},
{name => 'product', desc => 'Product', in_new_bugmail => 1,
buglist => 1},
type => FIELD_TYPE_SINGLE_SELECT, buglist => 1},
{name => 'version', desc => 'Version', in_new_bugmail => 1,
buglist => 1},
{name => 'rep_platform', desc => 'Platform', in_new_bugmail => 1,
......
/Choice.pm/1.7/Fri Nov 7 11:34:44 2008//TBUGZILLA-3_3_3
/Choice.pm/1.10/Mon Feb 23 22:00:38 2009//TBUGZILLA-3_3_4
D
NBUGZILLA-3_3_3
NBUGZILLA-3_3_4
......@@ -62,6 +62,7 @@ use constant VALIDATORS => {
use constant CLASS_MAP => {
bug_status => 'Bugzilla::Status',
product => 'Bugzilla::Product',
};
use constant DEFAULT_MAP => {
......@@ -92,18 +93,18 @@ sub type {
# For generic classes, we use a lowercase class name, so as
# not to interfere with any real subclasses we might make some day.
my $package = "Bugzilla::Field::Choice::$field_name";
Bugzilla->request_cache->{"field_$package"} = $field_obj;
# We check defined so that the package and the stored field are only
# created once globally (at least per request). We prefix it with
# field_ (instead of suffixing it) so that we don't somehow conflict
# with the names of custom fields.
if (!defined Bugzilla->request_cache->{"field_$package"}) {
# This package only needs to be created once. We check if the DB_TABLE
# glob for this package already exists, which tells us whether or not
# we need to create the package (this works even under mod_perl, where
# this package definition will persist across requests)).
if (!defined *{"${package}::DB_TABLE"}) {
eval <<EOC;
package $package;
use base qw(Bugzilla::Field::Choice);
use constant DB_TABLE => '$field_name';
EOC
Bugzilla->request_cache->{"field_$package"} = $field_obj;
}
return $package;
......@@ -170,7 +171,7 @@ sub update {
}
$dbh->bz_commit_transaction();
return $changes;
return wantarray ? ($changes, $old_self) : $changes;
}
sub remove_from_db {
......@@ -189,6 +190,13 @@ sub remove_from_db {
ThrowUserError("fieldvalue_still_has_bugs",
{ field => $self->field, value => $self });
}
$self->_check_if_controller();
$self->SUPER::remove_from_db();
}
# Factored out to make life easier for subclasses.
sub _check_if_controller {
my $self = shift;
my $vis_fields = $self->controls_visibility_of_fields;
my $values = $self->controlled_values;
if (@$vis_fields || @$values) {
......@@ -196,7 +204,6 @@ sub remove_from_db {
{ value => $self, fields => [map($_->name, @$vis_fields)],
vals => $values });
}
$self->SUPER::remove_from_db();
}
......
......@@ -515,7 +515,7 @@ sub snapshot {
'attach_id' => $attach_id });
my @summaries;
foreach my $flag (@$flags) {
my $summary = $flag->type->name . $flag->status;
my $summary = $flag->setter->nick . ':' . $flag->type->name . $flag->status;
$summary .= "(" . $flag->requestee->login . ")" if $flag->requestee;
push(@summaries, $summary);
}
......@@ -625,10 +625,13 @@ sub update_activity {
my ($bug_id, $attach_id, $timestamp, $old_summaries, $new_summaries) = @_;
my $dbh = Bugzilla->dbh;
$old_summaries = join(", ", @$old_summaries);
$new_summaries = join(", ", @$new_summaries);
my ($removed, $added) = diff_strings($old_summaries, $new_summaries);
if ($removed ne $added) {
my ($removed, $added) = diff_arrays($old_summaries, $new_summaries);
if (scalar @$removed || scalar @$added) {
# Remove flag requester/setter information
foreach (@$removed, @$added) { s/^\S+:// }
$removed = join(", ", @$removed);
$added = join(", ", @$added);
my $field_id = get_field_id('flagtypes.name');
$dbh->do('INSERT INTO bugs_activity
(bug_id, attach_id, who, bug_when, fieldid, removed, added)
......
/CPAN.pm/1.2/Sun Dec 23 05:43:44 2007//TBUGZILLA-3_3_3
/DB.pm/1.59/Thu Jan 15 15:47:57 2009//TBUGZILLA-3_3_3
/Filesystem.pm/1.34/Fri Jan 23 21:34:42 2009//TBUGZILLA-3_3_3
/Localconfig.pm/1.16/Tue Feb 3 09:58:46 2009//TBUGZILLA-3_3_3
/Requirements.pm/1.60/Thu Jan 22 04:08:45 2009//TBUGZILLA-3_3_3
/Util.pm/1.17/Sat Jan 24 14:12:20 2009//TBUGZILLA-3_3_3
/CPAN.pm/1.2/Sun Dec 23 05:43:44 2007//TBUGZILLA-3_3_4
/DB.pm/1.61/Mon Mar 30 23:16:07 2009//TBUGZILLA-3_3_4
/Filesystem.pm/1.34/Fri Jan 23 21:34:42 2009//TBUGZILLA-3_3_4
/Localconfig.pm/1.16/Tue Feb 3 09:58:46 2009//TBUGZILLA-3_3_4
/Requirements.pm/1.60/Thu Jan 22 04:08:45 2009//TBUGZILLA-3_3_4
/Util.pm/1.17/Sat Jan 24 14:12:20 2009//TBUGZILLA-3_3_4
D
NBUGZILLA-3_3_3
NBUGZILLA-3_3_4
......@@ -554,6 +554,10 @@ sub update_table_definitions {
_add_visiblity_value_to_value_tables();
# 2009-03-02 arbingersys@gmail.com - Bug 423613
$dbh->bz_add_index('profiles', 'profiles_extern_id_idx',
{TYPE => 'UNIQUE', FIELDS => [qw(extern_id)]});
################################################################
# New --TABLE-- changes should go *** A B O V E *** this point #
################################################################
......@@ -3074,11 +3078,6 @@ sub _populate_bugs_fulltext {
if (UNIVERSAL::can($dbh, 'sql_group_concat')) {
print "Populating bugs_fulltext...";
print " (this can take a long time.)\n";
# XXX This hack should probably be moved elsewhere.
if ($dbh->isa('Bugzilla::DB::Mysql')) {
$dbh->do('SET SESSION group_concat_max_len = 128000000');
$dbh->do('SET SESSION max_allowed_packet = 128000000');
}
$dbh->do(
q{INSERT INTO bugs_fulltext (bug_id, short_desc, comments,
comments_noprivate)
......
/Mailer.pm/1.2/Wed Dec 24 04:30:55 2008//TBUGZILLA-3_3_3
/Mailer.pm/1.2/Wed Dec 24 04:30:55 2008//TBUGZILLA-3_3_4
D
NBUGZILLA-3_3_3
NBUGZILLA-3_3_4
/Runner.pm/1.2/Sat Dec 27 00:52:12 2008//TBUGZILLA-3_3_3
/Runner.pm/1.2/Sat Dec 27 00:52:12 2008//TBUGZILLA-3_3_4
D
NBUGZILLA-3_3_3
NBUGZILLA-3_3_4
......@@ -62,7 +62,20 @@ sub MessageToMTA {
return;
}
my $email = ref($msg) ? $msg : Email::MIME->new($msg);
my $email;
if (ref $msg) {
$email = $msg;
}
else {
# RFC 2822 requires us to have CRLF for our line endings and
# Email::MIME doesn't do this for us. We use \015 (CR) and \012 (LF)
# directly because Perl translates "\n" depending on what platform
# you're running on. See http://perldoc.perl.org/perlport.html#Newlines
# We check for multiple CRs because of this Template-Toolkit bug:
# https://rt.cpan.org/Ticket/Display.html?id=43345
$msg =~ s/(?:\015+)?\012/\015\012/msg;
$email = new Email::MIME($msg);
}
# We add this header to uniquely identify all email that we
# send as coming from this Bugzilla installation.
......
......@@ -31,7 +31,9 @@ use Bugzilla::Install::Requirements;
use Bugzilla::Mailer;
use Bugzilla::Series;
use base qw(Bugzilla::Object);
# Currently, we only implement enough of the Bugzilla::Field::Choice
# interface to control the visibility of other fields.
use base qw(Bugzilla::Field::Choice);
use constant DEFAULT_CLASSIFICATION_ID => 1;
......@@ -40,6 +42,10 @@ use constant DEFAULT_CLASSIFICATION_ID => 1;
###############################
use constant DB_TABLE => 'products';
# Reset these back to the Bugzilla::Object defaults, instead of the
# Bugzilla::Field::Choice defaults.
use constant NAME_FIELD => 'name';
use constant LIST_ORDER => 'name';
use constant DB_COLUMNS => qw(
id
......@@ -372,6 +378,8 @@ sub remove_from_db {
$dbh->bz_start_transaction();
$self->_check_if_controller();
if ($self->bug_count) {
if (Bugzilla->params->{'allowbugdeletion'}) {
require Bugzilla::Bug;
......@@ -523,6 +531,20 @@ sub _check_votes {
return $votes;
}
#####################################
# Implement Bugzilla::Field::Choice #
#####################################
sub field {
my $invocant = shift;
my $class = ref $invocant || $invocant;
my $cache = Bugzilla->request_cache;
$cache->{"field_$class"} ||= new Bugzilla::Field({ name => 'product' });
return $cache->{"field_$class"};