summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
Diffstat (limited to 'extensions')
-rw-r--r--extensions/AntiSpam/lib/Config.pm2
-rw-r--r--extensions/BMO/Extension.pm140
-rwxr-xr-xextensions/BMO/bin/bug_1093952.pl2
-rwxr-xr-xextensions/BMO/bin/bug_1141452.pl2
-rwxr-xr-xextensions/BMO/bin/migrate-github-pull-requests.pl2
-rw-r--r--extensions/BMO/template/en/default/bug/create/create-mozpr.html.tmpl2
-rw-r--r--extensions/BMO/template/en/default/bug/create/create-poweredby.html.tmpl2
-rw-r--r--extensions/BMO/template/en/default/bug/create/create-web-bounty.html.tmpl2
-rw-r--r--extensions/BMO/template/en/default/bug/create/user-message.html.tmpl2
-rw-r--r--extensions/BMO/template/en/default/pages/bug-writing.html.tmpl2
-rw-r--r--extensions/BMO/template/en/default/pages/etiquette.html.tmpl2
-rw-r--r--extensions/BMO/template/en/default/pages/group_admins.html.tmpl2
-rw-r--r--extensions/BugModal/Extension.pm10
-rw-r--r--extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl2
-rw-r--r--extensions/BzAPI/Extension.pm9
-rw-r--r--extensions/ComponentWatching/Extension.pm6
-rw-r--r--extensions/ContributorEngagement/Extension.pm5
-rw-r--r--extensions/EditComments/Extension.pm4
-rw-r--r--extensions/FlagTypeComment/Extension.pm19
-rw-r--r--extensions/GuidedBugEntry/template/en/default/guided/guided.html.tmpl2
-rw-r--r--extensions/MozProjectReview/disabled0
-rw-r--r--extensions/MozReview/disabled0
-rw-r--r--extensions/PhabBugz/disabled0
-rw-r--r--extensions/PhabBugz/lib/Util.pm2
-rw-r--r--extensions/Push/Config.pm6
-rw-r--r--extensions/Push/disabled0
-rw-r--r--extensions/Push/lib/Connector/TCL.pm353
-rw-r--r--extensions/RestrictComments/Extension.pm4
-rw-r--r--extensions/Review/Extension.pm8
-rwxr-xr-xextensions/Review/bin/migrate_mentor_from_whiteboard.pl2
-rw-r--r--extensions/Review/lib/WebService.pm2
-rw-r--r--extensions/SecureMail/Extension.pm5
-rw-r--r--extensions/TagNewUsers/Extension.pm15
-rwxr-xr-xextensions/TrackingFlags/bin/bug_825946.pl2
-rwxr-xr-xextensions/TrackingFlags/bin/bulk_flag_clear.pl2
-rw-r--r--extensions/TrackingFlags/disabled0
-rw-r--r--extensions/UserProfile/Extension.pm4
37 files changed, 215 insertions, 409 deletions
diff --git a/extensions/AntiSpam/lib/Config.pm b/extensions/AntiSpam/lib/Config.pm
index e35a7f001..278baea8f 100644
--- a/extensions/AntiSpam/lib/Config.pm
+++ b/extensions/AntiSpam/lib/Config.pm
@@ -55,7 +55,7 @@ sub get_param_list {
"This account has been automatically disabled as a result of " .
"a high number of comments tagged as abusive.<br>\n<br>\n" .
"All interactions on Bugzilla should follow our " .
- "<a href=\"https://bugzilla.mozilla.org/page.cgi?id=etiquette.html\">" .
+ "<a href=\"" . Bugzilla->localconfig->{'urlbase'} . "page.cgi?id=etiquette.html\">" .
"etiquette guidelines</a>.<br>\n<br>\n" .
"Please contact the address at the end of this message if you " .
"believe this to be an error, or if you would like your account " .
diff --git a/extensions/BMO/Extension.pm b/extensions/BMO/Extension.pm
index 3b1c03eec..7499f0d1c 100644
--- a/extensions/BMO/Extension.pm
+++ b/extensions/BMO/Extension.pm
@@ -46,6 +46,7 @@ use Bugzilla::User;
use Bugzilla::UserAgent qw(detect_platform detect_op_sys);
use Bugzilla::User::Setting;
use Bugzilla::Util;
+use Bugzilla::PSGI qw(compile_cgi);
use Date::Parse;
use DateTime;
@@ -878,7 +879,7 @@ sub object_end_of_create {
# Add default searches to new user's footer
my $dbh = Bugzilla->dbh;
- my $sharer = Bugzilla::User->new({ name => 'nobody@mozilla.org' })
+ my $sharer = Bugzilla::User->new({ name => Bugzilla->params->{'nobody_user'} })
or return;
my $group = Bugzilla::Group->new({ name => 'everyone' })
or return;
@@ -919,7 +920,7 @@ sub _bug_reporters_hw_os {
sub _bug_is_unassigned {
my ($self) = @_;
my $assignee = $self->assigned_to->login;
- return $assignee eq 'nobody@mozilla.org' || $assignee =~ /\.bugs$/;
+ return $assignee eq Bugzilla->params->{'nobody_user'} || $assignee =~ /\.bugs$/;
}
sub _bug_has_current_patch {
@@ -1100,7 +1101,7 @@ sub object_start_of_update {
# and the assignee isn't a real person
return unless
- $new_bug->assigned_to->login eq 'nobody@mozilla.org'
+ $new_bug->assigned_to->login eq Bugzilla->params->{'nobody_user'}
|| $new_bug->assigned_to->login =~ /\.bugs$/;
# and the user can set the status to NEW
@@ -1527,15 +1528,15 @@ sub install_update_db {
"www.mozilla.org" => 'websites-security',
);
# 1. Set all to core-security by default
- my $core_sec_group = Bugzilla::Group->new({ name => 'core-security' });
+ my $core_sec_group = Bugzilla::Group->new({ name => Bugzilla->params->{insidergroup} });
$dbh->do("UPDATE products SET security_group_id = ?", undef, $core_sec_group->id);
# 2. Update the ones that have explicit security groups
foreach my $prod_name (keys %product_sec_groups) {
my $group_name = $product_sec_groups{$prod_name};
- next if $group_name eq 'core-security'; # already done
+ next if $group_name eq Bugzilla->params->{insidergroup}; # already done
my $group = Bugzilla::Group->new({ name => $group_name, cache => 1 });
if (!$group) {
- warn "Security group $group_name not found. Using core-security instead.\n";
+ warn "Security group $group_name not found. Using insider group instead.\n";
next;
}
$dbh->do("UPDATE products SET security_group_id = ? WHERE name = ?", undef, $group->id, $prod_name);
@@ -1595,7 +1596,7 @@ sub field_end_of_create {
my $name = $field->name;
if (Bugzilla->usage_mode == USAGE_MODE_CMDLINE) {
- Bugzilla->set_user(Bugzilla::User->check({ name => 'nobody@mozilla.org' }));
+ Bugzilla->set_user(Bugzilla::User->check({ name => Bugzilla->params->{'nobody_user'} }));
print "Creating IT permission grant bug for new field '$name'...";
}
@@ -1666,6 +1667,28 @@ sub webservice {
$dispatch->{BMO} = "Bugzilla::Extension::BMO::WebService";
}
+sub psgi_builder {
+ my ($self, $args) = @_;
+ my $mount = $args->{mount};
+
+ my $ses_index = Plack::Builder::builder(sub {
+ my $auth_user = Bugzilla->localconfig->{ses_username};
+ my $auth_pass = Bugzilla->localconfig->{ses_password};
+ Plack::Builder::enable("Auth::Basic", authenticator => sub {
+ my ($username, $password, $env) = @_;
+ return ( $auth_user
+ && $auth_pass
+ && $username
+ && $password
+ && $username eq $auth_user
+ && $password eq $auth_pass );
+ });
+ compile_cgi("ses/index.cgi");
+ });
+
+ $mount->{'ses/index.cgi'} = $ses_index;
+}
+
our $search_content_matches;
BEGIN {
$search_content_matches = \&Bugzilla::Search::_content_matches;
@@ -1951,7 +1974,7 @@ sub _post_employee_incident_bug {
my ($investigate_bug, $ssh_key_bug);
my $old_user = Bugzilla->user;
eval {
- Bugzilla->set_user(Bugzilla::User->new({ name => 'nobody@mozilla.org' }));
+ Bugzilla->set_user(Bugzilla::User->new({ name => Bugzilla->params->{'nobody_user'} }));
my $new_user = Bugzilla->user;
# HACK: User needs to be in the editbugs and primary bug's group to allow
@@ -2719,4 +2742,105 @@ sub enter_bug_entrydefaultvars {
}
}
+sub app_startup {
+ my ($self, $args) = @_;
+ my $app = $args->{app};
+ my $r = $app->routes;
+
+ $r->get(
+ '/favicon.ico' => sub {
+ my $c = shift;
+ $c->reply->file(
+ $c->app->home->child('extensions/BMO/web/images/favicon.ico')
+ );
+ }
+ );
+
+ $r->any( '/:REWRITE_itrequest' => [ REWRITE_itrequest => qr{form[\.:]itrequest} ] )
+ ->to( 'CGI#enter_bug_cgi' => { 'product' => 'Infrastructure & Operations', 'format' => 'itrequest' } );
+ $r->any( '/:REWRITE_mozlist' => [ REWRITE_mozlist => qr{form[\.:]mozlist} ] )
+ ->to( 'CGI#enter_bug_cgi' => { 'product' => 'mozilla.org', 'format' => 'mozlist' } );
+ $r->any( '/:REWRITE_poweredby' => [ REWRITE_poweredby => qr{form[\.:]poweredby} ] )
+ ->to( 'CGI#enter_bug_cgi' => { 'product' => 'mozilla.org', 'format' => 'poweredby' } );
+ $r->any( '/:REWRITE_presentation' => [ REWRITE_presentation => qr{form[\.:]presentation} ] )
+ ->to( 'cgi#enter_bug_cgi' => { 'product' => 'mozilla.org', 'format' => 'presentation' } );
+ $r->any( '/:REWRITE_trademark' => [ REWRITE_trademark => qr{form[\.:]trademark} ] )
+ ->to( 'cgi#enter_bug_cgi' => { 'product' => 'mozilla.org', 'format' => 'trademark' } );
+ $r->any( '/:REWRITE_recoverykey' => [ REWRITE_recoverykey => qr{form[\.:]recoverykey} ] )
+ ->to( 'cgi#enter_bug_cgi' => { 'product' => 'mozilla.org', 'format' => 'recoverykey' } );
+ $r->any( '/:REWRITE_legal' => [ REWRITE_legal => qr{form[\.:]legal} ] )
+ ->to( 'CGI#enter_bug_cgi' => { 'product' => 'Legal', 'format' => 'legal' }, );
+ $r->any( '/:REWRITE_recruiting' => [ REWRITE_recruiting => qr{form[\.:]recruiting} ] )
+ ->to( 'CGI#enter_bug_cgi' => { 'product' => 'Recruiting', 'format' => 'recruiting' } );
+ $r->any( '/:REWRITE_intern' => [ REWRITE_intern => qr{form[\.:]intern} ] )
+ ->to( 'CGI#enter_bug_cgi' => { 'product' => 'Recruiting', 'format' => 'intern' } );
+ $r->any( '/:REWRITE_mozpr' => [ REWRITE_mozpr => qr{form[\.:]mozpr} ] )
+ ->to( 'CGI#enter_bug_cgi' => { 'product' => 'Mozilla PR', 'format' => 'mozpr' }, );
+ $r->any( '/:REWRITE_reps_mentorship' => [ REWRITE_reps_mentorship => qr{form[\.:]reps[\.:]mentorship} ] )
+ ->to( 'CGI#enter_bug_cgi' => { 'product' => 'Mozilla Reps', 'format' => 'mozreps' }, );
+ $r->any( '/:REWRITE_reps_budget' => [ REWRITE_reps_budget => qr{form[\.:]reps[\.:]budget} ] )
+ ->to( 'CGI#enter_bug_cgi' => { 'product' => 'Mozilla Reps', 'format' => 'remo-budget' } );
+ $r->any( '/:REWRITE_reps_swag' => [ REWRITE_reps_swag => qr{form[\.:]reps[\.:]swag} ] )
+ ->to( 'CGI#enter_bug_cgi' => { 'product' => 'Mozilla Reps', 'format' => 'remo-swag' } );
+ $r->any( '/:REWRITE_reps_it' => [ REWRITE_reps_it => qr{form[\.:]reps[\.:]it} ] )
+ ->to( 'CGI#enter_bug_cgi' => { 'product' => 'Mozilla Reps', 'format' => 'remo-it' } );
+ $r->any( '/:REWRITE_reps_payment' => [ REWRITE_reps_payment => qr{form[\.:]reps[\.:]payment} ] )
+ ->to( 'CGI#page_cgi' => { 'id' => 'remo-form-payment.html' } );
+ $r->any( '/:REWRITE_csa_discourse' => [ REWRITE_csa_discourse => qr{form[\.:]csa[\.:]discourse} ] )
+ ->to( 'CGI#enter_bug_cgi' => { 'product' => 'Infrastructure & Operations', 'format' => 'csa-discourse' } );
+ $r->any( '/:REWRITE_employee_incident' => [ REWRITE_employee_incident => qr{form[\.:]employee[\.\-:]incident} ] )
+ ->to( 'CGI#enter_bug_cgi' => { 'product' => 'mozilla.org', 'format' => 'employee-incident' } );
+ $r->any( '/:REWRITE_brownbag' => [ REWRITE_brownbag => qr{form[\.:]brownbag} ] )
+ ->to( 'CGI#https_air_mozilla_org_requests' => {} );
+ $r->any( '/:REWRITE_finance' => [ REWRITE_finance => qr{form[\.:]finance} ] )
+ ->to( 'CGI#enter_bug_cgi' => { 'product' => 'Finance', 'format' => 'finance' } );
+ $r->any(
+ '/:REWRITE_moz_project_review' => [ REWRITE_moz_project_review => qr{form[\.:]moz[\.\-:]project[\.\-:]review} ]
+ )->to( 'CGI#enter_bug_cgi' => { 'product' => 'mozilla.org', 'format' => 'moz-project-review' } );
+ $r->any( '/:REWRITE_docs' => [ REWRITE_docs => qr{form[\.:]docs?} ] )
+ ->to( 'CGI#enter_bug_cgi' => { 'product' => 'Developer Documentation', 'format' => 'doc' } );
+ $r->any( '/:REWRITE_mdn' => [ REWRITE_mdn => qr{form[\.:]mdn?} ] )
+ ->to( 'CGI#enter_bug_cgi' => { 'format' => 'mdn', 'product' => 'developer.mozilla.org' } );
+ $r->any( '/:REWRITE_swag_gear' => [ REWRITE_swag_gear => qr{form[\.:](swag|gear)} ] )
+ ->to( 'CGI#enter_bug_cgi' => { 'format' => 'swag', 'product' => 'Marketing' } );
+ $r->any( '/:REWRITE_costume' => [ REWRITE_costume => qr{form[\.:]costume} ] )
+ ->to( 'CGI#enter_bug_cgi' => { 'product' => 'Marketing', 'format' => 'costume' } );
+ $r->any( '/:REWRITE_ipp' => [ REWRITE_ipp => qr{form[\.:]ipp} ] )
+ ->to( 'CGI#enter_bug_cgi' => { 'product' => 'Internet Public Policy', 'format' => 'ipp' } );
+ $r->any( '/:REWRITE_creative' => [ REWRITE_creative => qr{form[\.:]creative} ] )
+ ->to( 'CGI#enter_bug_cgi' => { 'format' => 'creative', 'product' => 'Marketing' } );
+ $r->any( '/:REWRITE_user_engagement' => [ REWRITE_user_engagement => qr{form[\.:]user[\.\-:]engagement} ] )
+ ->to( 'CGI#enter_bug_cgi' => { 'format' => 'user-engagement', 'product' => 'Marketing' } );
+ $r->any( '/:REWRITE_dev_engagement_event' =>
+ [ REWRITE_dev_engagement_event => qr{form[\.:]dev[\.\-:]engagement[\.\-\:]event} ] )
+ ->to( 'CGI#enter_bug_cgi' => { 'product' => 'Developer Engagement', 'format' => 'dev-engagement-event' } );
+ $r->any( '/:REWRITE_mobile_compat' => [ REWRITE_mobile_compat => qr{form[\.:]mobile[\.\-:]compat} ] )
+ ->to( 'CGI#enter_bug_cgi' => { 'product' => 'Tech Evangelism', 'format' => 'mobile-compat' } );
+ $r->any( '/:REWRITE_web_bounty' => [ REWRITE_web_bounty => qr{form[\.:]web[\.:]bounty} ] )
+ ->to( 'CGI#enter_bug_cgi' => { 'format' => 'web-bounty', 'product' => 'mozilla.org' } );
+ $r->any( '/:REWRITE_automative' => [ REWRITE_automative => qr{form[\.:]automative} ] )
+ ->to( 'CGI#enter_bug_cgi' => { 'product' => 'Testing', 'format' => 'automative' } );
+ $r->any( '/:REWRITE_comm_newsletter' => [ REWRITE_comm_newsletter => qr{form[\.:]comm[\.:]newsletter} ] )
+ ->to( 'CGI#enter_bug_cgi' => { 'format' => 'comm-newsletter', 'product' => 'Marketing' } );
+ $r->any( '/:REWRITE_screen_share_whitelist' =>
+ [ REWRITE_screen_share_whitelist => qr{form[\.:]screen[\.:]share[\.:]whitelist} ] )
+ ->to( 'CGI#enter_bug_cgi' => { 'format' => 'screen-share-whitelist', 'product' => 'Firefox' } );
+ $r->any( '/:REWRITE_data_compliance' => [ REWRITE_data_compliance => qr{form[\.:]data[\.\-:]compliance} ] )
+ ->to( 'CGI#enter_bug_cgi' => { 'product' => 'Data Compliance', 'format' => 'data-compliance' } );
+ $r->any( '/:REWRITE_fsa_budget' => [ REWRITE_fsa_budget => qr{form[\.:]fsa[\.:]budget} ] )
+ ->to( 'CGI#enter_bug_cgi' => { 'product' => 'FSA', 'format' => 'fsa-budget' } );
+ $r->any( '/:REWRITE_triage_request' => [ REWRITE_triage_request => qr{form[\.:]triage[\.\-]request} ] )
+ ->to( 'CGI#page_cgi' => { 'id' => 'triage_request.html' } );
+ $r->any( '/:REWRITE_crm_CRM' => [ REWRITE_crm_CRM => qr{form[\.:](crm|CRM)} ] )
+ ->to( 'CGI#enter_bug_cgi' => { 'format' => 'crm', 'product' => 'Marketing' } );
+ $r->any( '/:REWRITE_nda' => [ REWRITE_nda => qr{form[\.:]nda} ] )
+ ->to( 'CGI#enter_bug_cgi' => { 'product' => 'Legal', 'format' => 'nda' } );
+ $r->any( '/:REWRITE_name_clearance' => [ REWRITE_name_clearance => qr{form[\.:]name[\.:]clearance} ] )
+ ->to( 'CGI#enter_bug_cgi' => { 'format' => 'name-clearance', 'product' => 'Legal' } );
+ $r->any( '/:REWRITE_shield_studies' => [ REWRITE_shield_studies => qr{form[\.:]shield[\.:]studies} ] )
+ ->to( 'CGI#enter_bug_cgi' => { 'product' => 'Shield', 'format' => 'shield-studies' } );
+ $r->any( '/:REWRITE_client_bounty' => [ REWRITE_client_bounty => qr{form[\.:]client[\.:]bounty} ] )
+ ->to( 'CGI#enter_bug_cgi' => { 'product' => 'Firefox', 'format' => 'client-bounty' } );
+}
+
__PACKAGE__->NAME;
diff --git a/extensions/BMO/bin/bug_1093952.pl b/extensions/BMO/bin/bug_1093952.pl
index 735c6a37a..fd891f4ae 100755
--- a/extensions/BMO/bin/bug_1093952.pl
+++ b/extensions/BMO/bin/bug_1093952.pl
@@ -52,7 +52,7 @@ printf "About to fix %s bugs\n", scalar(@$bugs);
print "Press <Ctrl-C> to stop or <Enter> to continue...\n";
getc();
-my $nobody = Bugzilla::User->check({ name => 'nobody@mozilla.org' });
+my $nobody = Bugzilla::User->check({ name => Bugzilla->params->{'nobody_user'} });
my $field = Bugzilla::Field->check({ name => 'status_whiteboard' });
my $when = $dbh->selectrow_array('SELECT LOCALTIMESTAMP(0)');
diff --git a/extensions/BMO/bin/bug_1141452.pl b/extensions/BMO/bin/bug_1141452.pl
index 869593802..155c4704c 100755
--- a/extensions/BMO/bin/bug_1141452.pl
+++ b/extensions/BMO/bin/bug_1141452.pl
@@ -50,7 +50,7 @@ printf "About to fix %s bugs\n", scalar(@$flags);
print "Press <Ctrl-C> to stop or <Enter> to continue...\n";
getc();
-my $nobody = Bugzilla::User->check({ name => 'nobody@mozilla.org' });
+my $nobody = Bugzilla::User->check({ name => Bugzilla->params->{'nobody_user'} });
my $when = $dbh->selectrow_array('SELECT LOCALTIMESTAMP(0)');
$dbh->bz_start_transaction();
diff --git a/extensions/BMO/bin/migrate-github-pull-requests.pl b/extensions/BMO/bin/migrate-github-pull-requests.pl
index 53c1727b5..c39778a4a 100755
--- a/extensions/BMO/bin/migrate-github-pull-requests.pl
+++ b/extensions/BMO/bin/migrate-github-pull-requests.pl
@@ -23,7 +23,7 @@ use Bugzilla::User;
use Bugzilla::Util qw(trim);
my $dbh = Bugzilla->dbh;
-my $nobody = Bugzilla::User->check({ name => 'nobody@mozilla.org' });
+my $nobody = Bugzilla::User->check({ name => Bugzilla->params->{'nobody_user'} });
my $field = Bugzilla::Field->check({ name => 'attachments.mimetype' });
# grab list of suitable attachments
diff --git a/extensions/BMO/template/en/default/bug/create/create-mozpr.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-mozpr.html.tmpl
index 697542ead..0bd1c94d7 100644
--- a/extensions/BMO/template/en/default/bug/create/create-mozpr.html.tmpl
+++ b/extensions/BMO/template/en/default/bug/create/create-mozpr.html.tmpl
@@ -297,7 +297,7 @@ function validate_form() {
<input type="hidden" name="version" value="unspecified">
<input type="hidden" name="bug_severity" value="normal">
<input type="hidden" name="group" value="pr-private">
-<input type="hidden" name="assigned_to" id="assigned_to" value="nobody@mozilla.org">
+<input type="hidden" name="assigned_to" id="assigned_to" value="[% Param('nobody_user') FILTER html %]">
<input type="hidden" name="token" value="[% token FILTER html %]">
<div class="head">
diff --git a/extensions/BMO/template/en/default/bug/create/create-poweredby.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-poweredby.html.tmpl
index d6243c73b..9c0c4780d 100644
--- a/extensions/BMO/template/en/default/bug/create/create-poweredby.html.tmpl
+++ b/extensions/BMO/template/en/default/bug/create/create-poweredby.html.tmpl
@@ -43,7 +43,7 @@ please provide some information about your application or product.</p>
<input type="hidden" name="priority" value="--">
<input type="hidden" name="op_sys" value="Other">
<input type="hidden" name="version" value="unspecified">
- <input type="hidden" name="assigned_to" value="nobody@mozilla.org">
+ <input type="hidden" name="assigned_to" value="[% Param('nobody_user') FILTER html %]">
<input type="hidden" name="cc" value="liz@mozilla.com">
<input type="hidden" name="groups" value="marketing-private">
<input type="hidden" name="token" value="[% token FILTER html %]">
diff --git a/extensions/BMO/template/en/default/bug/create/create-web-bounty.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-web-bounty.html.tmpl
index 92517cb80..803f2a746 100644
--- a/extensions/BMO/template/en/default/bug/create/create-web-bounty.html.tmpl
+++ b/extensions/BMO/template/en/default/bug/create/create-web-bounty.html.tmpl
@@ -88,7 +88,7 @@ function validateAndSubmit() {
<input type="hidden" name="token" value="[% token FILTER html %]">
<div class="head_desc">
- <a href="https://developer.mozilla.org/docs/Mozilla/QA/Bug_writing_guidelines">
+ <a href="[% terms.BugWritingGuidelinesURL %]">
[% terms.Bug %] writing guidelines</a>
</div>
diff --git a/extensions/BMO/template/en/default/bug/create/user-message.html.tmpl b/extensions/BMO/template/en/default/bug/create/user-message.html.tmpl
index 6ecd0bc75..d3c7412bf 100644
--- a/extensions/BMO/template/en/default/bug/create/user-message.html.tmpl
+++ b/extensions/BMO/template/en/default/bug/create/user-message.html.tmpl
@@ -17,7 +17,7 @@
[% END +%]
[% UNLESS no_bug_guidelines %]
Before reporting a [% terms.bug %], make sure you've read our
- <a href="https://developer.mozilla.org/docs/Mozilla/QA/Bug_writing_guidelines">
+ <a href="[% terms.BugWritingGuidelinesURL %]">
[% terms.bug %] writing guidelines</a> and double checked that your [% terms.bug %] hasn't already
been reported. Consult our list of <a href="https://bugzilla.mozilla.org/duplicates.cgi">
most frequently reported [% terms.bugs %]</a> and <a href="https://bugzilla.mozilla.org/query.cgi">
diff --git a/extensions/BMO/template/en/default/pages/bug-writing.html.tmpl b/extensions/BMO/template/en/default/pages/bug-writing.html.tmpl
index e1c67605f..dc253ee03 100644
--- a/extensions/BMO/template/en/default/pages/bug-writing.html.tmpl
+++ b/extensions/BMO/template/en/default/pages/bug-writing.html.tmpl
@@ -7,5 +7,5 @@
#%]
[% PROCESS global/redirect.html.tmpl
- url = "https://developer.mozilla.org/docs/Mozilla/QA/Bug_writing_guidelines"
+ url = terms.BugWritingGuidelinesURL
%]
diff --git a/extensions/BMO/template/en/default/pages/etiquette.html.tmpl b/extensions/BMO/template/en/default/pages/etiquette.html.tmpl
index 45dd5bd65..fe7d2cd3d 100644
--- a/extensions/BMO/template/en/default/pages/etiquette.html.tmpl
+++ b/extensions/BMO/template/en/default/pages/etiquette.html.tmpl
@@ -173,7 +173,7 @@
<h2>See Also</h2>
<p>
- <a href="https://developer.mozilla.org/docs/Mozilla/QA/Bug_writing_guidelines">The [% terms.Bug %] Writing Guidelines</a>.
+ <a href="[% terms.BugWritingGuidelinesURL %]">The [% terms.Bug %] Writing Guidelines</a>.
</p>
[% INCLUDE global/footer.html.tmpl %]
diff --git a/extensions/BMO/template/en/default/pages/group_admins.html.tmpl b/extensions/BMO/template/en/default/pages/group_admins.html.tmpl
index cfa3bd3ea..838a1e84a 100644
--- a/extensions/BMO/template/en/default/pages/group_admins.html.tmpl
+++ b/extensions/BMO/template/en/default/pages/group_admins.html.tmpl
@@ -39,7 +39,7 @@
[% group.name FILTER html %]</span>
</td>
<td nowrap>
- [% IF group.owner.login == 'nobody@mozilla.org' %]
+ [% IF group.owner.login == Param('nobody_user') %]
&ndash;
[% ELSE %]
[% INCLUDE global/user.html.tmpl who = group.owner %]
diff --git a/extensions/BugModal/Extension.pm b/extensions/BugModal/Extension.pm
index 1291fca21..ef9c93a37 100644
--- a/extensions/BugModal/Extension.pm
+++ b/extensions/BugModal/Extension.pm
@@ -188,10 +188,12 @@ sub template_before_process {
return if exists $bug->{error};
# trigger loading of tracking flags
- Bugzilla::Extension::TrackingFlags->template_before_process({
- file => 'bug/edit.html.tmpl',
- vars => $vars,
- });
+ if (Bugzilla->has_extension('TrackingFlags')) {
+ Bugzilla::Extension::TrackingFlags->template_before_process({
+ file => 'bug/edit.html.tmpl',
+ vars => $vars,
+ });
+ }
if (any { $bug->product eq $_ } READABLE_BUG_STATUS_PRODUCTS) {
my @flags = map { { name => $_->name, status => $_->status } } @{$bug->flags};
diff --git a/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl b/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl
index e926c04b4..bcbea3f15 100644
--- a/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl
+++ b/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl
@@ -19,7 +19,7 @@
# these are used in a few places
is_cced = bug.cc.contains(user.login);
- unassigned = (bug.assigned_to.login == "nobody@mozilla.org")
+ unassigned = (bug.assigned_to.login == Param('nobody_user'))
|| (bug.assigned_to.login.search('\.bugs$'));
# custom fields that have custom rendering, or should not be rendered
diff --git a/extensions/BzAPI/Extension.pm b/extensions/BzAPI/Extension.pm
index bb9805134..1f7cce04a 100644
--- a/extensions/BzAPI/Extension.pm
+++ b/extensions/BzAPI/Extension.pm
@@ -15,6 +15,7 @@ use base qw(Bugzilla::Extension);
use Bugzilla::Extension::BzAPI::Constants;
use Bugzilla::Extension::BzAPI::Util qw(fix_credentials filter_wants_nocache);
+use Bugzilla::PSGI qw(compile_cgi);
use Bugzilla::Error;
use Bugzilla::Util qw(trick_taint datetime_from);
@@ -188,6 +189,14 @@ sub webservice_status_code_map {
$status_code_map->{51} = STATUS_BAD_REQUEST;
}
+sub psgi_builder {
+ my ($self, $args) = @_;
+ my $mount = $args->{mount};
+
+ $mount->{'bzapi'} = compile_cgi('extensions/BzAPI/bin/rest.cgi');
+}
+
+
#####################
# Utility Functions #
#####################
diff --git a/extensions/ComponentWatching/Extension.pm b/extensions/ComponentWatching/Extension.pm
index 25155f90b..fdeedff98 100644
--- a/extensions/ComponentWatching/Extension.pm
+++ b/extensions/ComponentWatching/Extension.pm
@@ -23,7 +23,7 @@ use Bugzilla::Util qw(detaint_natural trim trick_taint);
our $VERSION = '2';
use constant REQUIRE_WATCH_USER => 1;
-use constant DEFAULT_ASSIGNEE => 'nobody@mozilla.org';
+use constant DEFAULT_ASSIGNEE => Bugzilla->params->{'nobody_user'};
use constant REL_COMPONENT_WATCHER => 15;
@@ -158,7 +158,9 @@ sub object_columns {
my $columns = $args->{columns};
return unless $class->isa('Bugzilla::Component');
- push(@$columns, 'watch_user');
+ if (Bugzilla->dbh->bz_column_info($class->DB_TABLE, 'watch_user')) {
+ push @$columns, 'watch_user';
+ }
}
sub object_update_columns {
diff --git a/extensions/ContributorEngagement/Extension.pm b/extensions/ContributorEngagement/Extension.pm
index 949517ecf..35eba24ab 100644
--- a/extensions/ContributorEngagement/Extension.pm
+++ b/extensions/ContributorEngagement/Extension.pm
@@ -70,7 +70,10 @@ sub object_columns {
my ($self, $args) = @_;
my ($class, $columns) = @$args{qw(class columns)};
if ($class->isa('Bugzilla::User')) {
- push(@$columns, 'first_patch_reviewed_id');
+ my $dbh = Bugzilla->dbh;
+ if ($dbh->bz_column_info($class->DB_TABLE, 'first_patch_reviewed_id')) {
+ push @$columns, 'first_patch_reviewed_id';
+ }
}
}
diff --git a/extensions/EditComments/Extension.pm b/extensions/EditComments/Extension.pm
index ab19ab6e7..e2ace3f23 100644
--- a/extensions/EditComments/Extension.pm
+++ b/extensions/EditComments/Extension.pm
@@ -191,7 +191,9 @@ sub object_columns {
my ($self, $args) = @_;
my ($class, $columns) = @$args{qw(class columns)};
if ($class->isa('Bugzilla::Comment')) {
- push(@$columns, 'edit_count');
+ if (Bugzilla->dbh->bz_column_info($class->DB_TABLE, 'edit_count')) {
+ push @$columns, 'edit_count';
+ }
}
}
diff --git a/extensions/FlagTypeComment/Extension.pm b/extensions/FlagTypeComment/Extension.pm
index 3ec506176..e7b34113d 100644
--- a/extensions/FlagTypeComment/Extension.pm
+++ b/extensions/FlagTypeComment/Extension.pm
@@ -127,13 +127,18 @@ sub _set_ftc_states {
'active_or_has_flags' => $bug->id,
});
- my $types = join(',', map { $_->id } @$flag_types);
- my $states = "'" . join("','", FLAGTYPE_COMMENT_STATES) . "'";
- $db_result = $dbh->selectall_arrayref(
- "SELECT type_id AS flagtype, on_status AS state, comment AS text
- FROM flagtype_comments
- WHERE type_id IN ($types) AND on_status IN ($states)",
- { Slice => {} });
+ if (@$flag_types) {
+ my $types = join(',', map { $_->id } @$flag_types);
+ my $states = "'" . join("','", FLAGTYPE_COMMENT_STATES) . "'";
+ $db_result = $dbh->selectall_arrayref(
+ "SELECT type_id AS flagtype, on_status AS state, comment AS text
+ FROM flagtype_comments
+ WHERE type_id IN ($types) AND on_status IN ($states)",
+ { Slice => {} });
+ }
+ else {
+ $db_result = [];
+ }
}
foreach my $row (@$db_result) {
diff --git a/extensions/GuidedBugEntry/template/en/default/guided/guided.html.tmpl b/extensions/GuidedBugEntry/template/en/default/guided/guided.html.tmpl
index e1a9e0bc5..7ffa04922 100644
--- a/extensions/GuidedBugEntry/template/en/default/guided/guided.html.tmpl
+++ b/extensions/GuidedBugEntry/template/en/default/guided/guided.html.tmpl
@@ -356,7 +356,7 @@ Product: <b><span id="dupes_product_name">?</span></b>:
<ul>
<li>Please fill out this form clearly, precisely and in as much detail as you can manage.</li>
<li>Please report only a single problem at a time.</li>
-<li><a href="https://developer.mozilla.org/docs/Mozilla/QA/Bug_writing_guidelines" target="_blank" rel="noopener noreferrer">These guidelines</a>
+<li><a href="[% terms.BugWritingGuidelinesURL %]" target="_blank" rel="noopener noreferrer">These guidelines</a>
explain how to write effective [% terms.bug %] reports.</li>
</ul>
diff --git a/extensions/MozProjectReview/disabled b/extensions/MozProjectReview/disabled
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/extensions/MozProjectReview/disabled
diff --git a/extensions/MozReview/disabled b/extensions/MozReview/disabled
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/extensions/MozReview/disabled
diff --git a/extensions/PhabBugz/disabled b/extensions/PhabBugz/disabled
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/extensions/PhabBugz/disabled
diff --git a/extensions/PhabBugz/lib/Util.pm b/extensions/PhabBugz/lib/Util.pm
index a7ae98744..a93533e75 100644
--- a/extensions/PhabBugz/lib/Util.pm
+++ b/extensions/PhabBugz/lib/Util.pm
@@ -102,7 +102,7 @@ sub get_bug_role_phids {
my @bug_users = ( $bug->reporter );
push(@bug_users, $bug->assigned_to)
- if $bug->assigned_to->email !~ /^nobody\@mozilla\.org$/;
+ if $bug->assigned_to->email != Bugzilla->params->{'nobody_user'};
push(@bug_users, $bug->qa_contact) if $bug->qa_contact;
push(@bug_users, @{ $bug->cc_users }) if @{ $bug->cc_users };
diff --git a/extensions/Push/Config.pm b/extensions/Push/Config.pm
index 860e31a23..59b78d5a2 100644
--- a/extensions/Push/Config.pm
+++ b/extensions/Push/Config.pm
@@ -42,12 +42,6 @@ use constant REQUIRED_MODULES => [
];
use constant OPTIONAL_MODULES => [
- # connectors need the ability to extend this
- {
- package => 'Net-SFTP',
- module => 'Net::SFTP',
- version => '0'
- },
{
package => 'XML-Simple',
module => 'XML::Simple',
diff --git a/extensions/Push/disabled b/extensions/Push/disabled
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/extensions/Push/disabled
diff --git a/extensions/Push/lib/Connector/TCL.pm b/extensions/Push/lib/Connector/TCL.pm
deleted file mode 100644
index f5b430e47..000000000
--- a/extensions/Push/lib/Connector/TCL.pm
+++ /dev/null
@@ -1,353 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This Source Code Form is "Incompatible With Secondary Licenses", as
-# defined by the Mozilla Public License, v. 2.0.
-
-package Bugzilla::Extension::Push::Connector::TCL;
-
-use 5.10.1;
-use strict;
-use warnings;
-
-use base 'Bugzilla::Extension::Push::Connector::Base';
-
-use Bugzilla::Constants;
-use Bugzilla::Extension::Push::Constants;
-use Bugzilla::Extension::Push::Serialise;
-use Bugzilla::Extension::Push::Util;
-use Bugzilla::User;
-use Bugzilla::Attachment;
-
-use Digest::MD5 qw(md5_hex);
-use Encode qw(encode_utf8);
-
-sub options {
- return (
- {
- name => 'tcl_user',
- label => 'Bugzilla TCL User',
- type => 'string',
- default => 'tcl@bugzilla.tld',
- required => 1,
- validate => sub {
- Bugzilla::User->new({ name => $_[0] })
- || die "Invalid Bugzilla user ($_[0])\n";
- },
- },
- {
- name => 'sftp_host',
- label => 'SFTP Host',
- type => 'string',
- default => '',
- required => 1,
- },
- {
- name => 'sftp_port',
- label => 'SFTP Port',
- type => 'string',
- default => '22',
- required => 1,
- validate => sub {
- $_[0] =~ /\D/ && die "SFTP Port must be an integer\n";
- },
- },
- {
- name => 'sftp_user',
- label => 'SFTP Username',
- type => 'string',
- default => '',
- required => 1,
- },
- {
- name => 'sftp_pass',
- label => 'SFTP Password',
- type => 'password',
- default => '',
- required => 1,
- },
- {
- name => 'sftp_remote_path',
- label => 'SFTP Remote Path',
- type => 'string',
- default => '',
- required => 0,
- },
- );
-}
-
-my $_instance;
-
-sub init {
- my ($self) = @_;
- $_instance = $self;
-}
-
-sub load_config {
- my ($self) = @_;
- $self->SUPER::load_config(@_);
-}
-
-sub should_send {
- my ($self, $message) = @_;
-
- my $data = $message->payload_decoded;
- my $bug_data = $self->_get_bug_data($data)
- || return 0;
-
- # sanity check user
- $self->{tcl_user} ||= Bugzilla::User->new({ name => $self->config->{tcl_user} });
- if (!$self->{tcl_user} || !$self->{tcl_user}->is_enabled) {
- return 0;
- }
-
- # only send bugs created by the tcl user
- unless ($bug_data->{reporter}->{id} == $self->{tcl_user}->id) {
- return 0;
- }
-
- # don't push changes made by the tcl user
- if ($data->{event}->{user}->{id} == $self->{tcl_user}->id) {
- return 0;
- }
-
- # send comments
- if ($data->{event}->{routing_key} eq 'comment.create') {
- return 0 if $data->{comment}->{is_private};
- return 1;
- }
-
- # send status and resolution updates
- foreach my $change (@{ $data->{event}->{changes} }) {
- return 1 if $change->{field} eq 'bug_status'
- || $change->{field} eq 'resolution'
- || $change->{field} eq 'cf_blocking_b2g';
- }
-
- # send attachments
- if ($data->{event}->{routing_key} =~ /^attachment\./) {
- return 0 if $data->{attachment}->{is_private};
- return 1;
- }
-
- # and nothing else
- return 0;
-}
-
-sub send {
- my ($self, $message) = @_;
- my $logger = Bugzilla->push_ext->logger;
- my $config = $self->config;
-
- require XML::Simple;
- require Net::SFTP;
-
- $self->{tcl_user} ||= Bugzilla::User->new({ name => $self->config->{tcl_user} });
- if (!$self->{tcl_user}) {
- return (PUSH_RESULT_TRANSIENT, "Invalid bugzilla-user (" . $self->config->{tcl_user} . ")");
- }
-
- # load the bug
- my $data = $message->payload_decoded;
- my $bug_data = $self->_get_bug_data($data);
-
- # build payload
- my $attachment;
- my %xml = (
- Mozilla_ID => $bug_data->{id},
- When => $data->{event}->{time},
- Who => $data->{event}->{user}->{login},
- Status => $bug_data->{status}->{name},
- Resolution => $bug_data->{resolution},
- Blocking_B2G => $bug_data->{cf_blocking_b2g},
- );
- if ($data->{event}->{routing_key} eq 'comment.create') {
- $xml{Comment} = $data->{comment}->{body};
- } elsif ($data->{event}->{routing_key} =~ /^attachment\.(\w+)/) {
- my $is_update = $1 eq 'modify';
- if (!$is_update) {
- $attachment = Bugzilla::Attachment->new($data->{attachment}->{id});
- }
- $xml{Attach} = {
- Attach_ID => $data->{attachment}->{id},
- Filename => $data->{attachment}->{file_name},
- Description => $data->{attachment}->{description},
- ContentType => $data->{attachment}->{content_type},
- IsPatch => $data->{attachment}->{is_patch} ? 'true' : 'false',
- IsObsolete => $data->{attachment}->{is_obsolete} ? 'true' : 'false',
- IsUpdate => $is_update ? 'true' : 'false',
- };
- }
-
- # convert to xml
- my $xml = XML::Simple::XMLout(
- \%xml,
- NoAttr => 1,
- RootName => 'sync',
- XMLDecl => 1,
- );
- $xml = encode_utf8($xml);
-
- # generate md5
- my $md5 = md5_hex($xml);
-
- # build filename
- my ($sec, $min, $hour, $day, $mon, $year) = localtime(time);
- my $change_set = $data->{event}->{change_set};
- $change_set =~ s/\.//g;
- my $filename = sprintf(
- '%04s%02d%02d%02d%02d%02d%s',
- $year + 1900,
- $mon + 1,
- $day,
- $hour,
- $min,
- $sec,
- $change_set,
- );
-
- # create temp files;
- my $temp_dir = File::Temp::Directory->new();
- my $local_dir = $temp_dir->dirname;
- _write_file("$local_dir/$filename.sync", $xml);
- _write_file("$local_dir/$filename.sync.check", $md5);
- _write_file("$local_dir/$filename.done", '');
- if ($attachment) {
- _write_file("$local_dir/$filename.sync.attach", $attachment->data);
- }
-
- my $remote_dir = $self->config->{sftp_remote_path} eq ''
- ? ''
- : $self->config->{sftp_remote_path} . '/';
-
- # send files via sftp
- $logger->debug("Connecting to " . $self->config->{sftp_host} . ":" . $self->config->{sftp_port});
- my $sftp = Net::SFTP->new(
- $self->config->{sftp_host},
- ssh_args => {
- port => $self->config->{sftp_port},
- },
- user => $self->config->{sftp_user},
- password => $self->config->{sftp_pass},
- );
-
- $logger->debug("Uploading $local_dir/$filename.sync");
- $sftp->put("$local_dir/$filename.sync", "$remote_dir$filename.sync")
- or return (PUSH_RESULT_ERROR, "Failed to upload $local_dir/$filename.sync");
-
- $logger->debug("Uploading $local_dir/$filename.sync.check");
- $sftp->put("$local_dir/$filename.sync.check", "$remote_dir$filename.sync.check")
- or return (PUSH_RESULT_ERROR, "Failed to upload $local_dir/$filename.sync.check");
-
- if ($attachment) {
- $logger->debug("Uploading $local_dir/$filename.sync.attach");
- $sftp->put("$local_dir/$filename.sync.attach", "$remote_dir$filename.sync.attach")
- or return (PUSH_RESULT_ERROR, "Failed to upload $local_dir/$filename.sync.attach");
- }
-
- $logger->debug("Uploading $local_dir/$filename.done");
- $sftp->put("$local_dir/$filename.done", "$remote_dir$filename.done")
- or return (PUSH_RESULT_ERROR, "Failed to upload $local_dir/$filename.done");
-
- # success
- return (PUSH_RESULT_OK, "uploaded $filename.sync");
-}
-
-sub _get_bug_data {
- my ($self, $data) = @_;
- my $target = $data->{event}->{target};
- if ($target eq 'bug') {
- return $data->{bug};
- } elsif (exists $data->{$target}->{bug}) {
- return $data->{$target}->{bug};
- } else {
- return;
- }
-}
-
-sub _write_file {
- my ($filename, $content) = @_;
- open(my $fh, ">", $filename) or die "Failed to write to $filename: $!\n";
- binmode($fh);
- print $fh $content;
- close($fh) or die "Failed to write to $filename: $!\n";
-}
-
-1;
-
-# File::Temp->newdir() requires a newer version of File::Temp than we have on
-# production, so here's a small inline package which performs the same task.
-
-package File::Temp::Directory;
-
-use strict;
-use warnings;
-
-use File::Temp;
-use File::Path qw(rmtree);
-use File::Spec;
-
-my @chars;
-
-sub new {
- my ($class) = @_;
- my $self = {};
- bless($self, $class);
-
- @chars = qw/ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
- a b c d e f g h i j k l m n o p q r s t u v w x y z
- 0 1 2 3 4 5 6 7 8 9 _
- /;
-
- $self->{TEMPLATE} = File::Spec->catdir(File::Spec->tmpdir, 'X' x 10);
- $self->{DIRNAME} = $self->_mktemp();
- return $self;
-}
-
-sub _mktemp {
- my ($self) = @_;
- my $path = $self->_random_name();
- while(1) {
- if (mkdir($path, 0700)) {
- # in case of odd umask
- chmod(0700, $path);
- return $path;
- } else {
- # abort with error if the reason for failure was anything except eexist
- die "Could not create directory $path: $!\n" unless ($!{EEXIST});
- # loop round for another try
- }
- $path = $self->_random_name();
- }
-
- return $path;
-}
-
-sub _random_name {
- my ($self) = @_;
- my $path = $self->{TEMPLATE};
- $path =~ s/X/$chars[int(rand(@chars))]/ge;
- return $path;
-}
-
-sub dirname {
- my ($self) = @_;
- return $self->{DIRNAME};
-}
-
-sub DESTROY {
- my ($self) = @_;
- local($., $@, $!, $^E, $?);
- if (-d $self->{DIRNAME}) {
- # Some versions of rmtree will abort if you attempt to remove the
- # directory you are sitting in. We protect that and turn it into a
- # warning. We do this because this occurs during object destruction and
- # so can not be caught by the user.
- eval { rmtree($self->{DIRNAME}, 0, 0); };
- warn $@ if ($@ && $^W);
- }
-}
-
-1;
-
diff --git a/extensions/RestrictComments/Extension.pm b/extensions/RestrictComments/Extension.pm
index 213a1c44a..e93540d5a 100644
--- a/extensions/RestrictComments/Extension.pm
+++ b/extensions/RestrictComments/Extension.pm
@@ -68,7 +68,9 @@ sub object_columns {
my ($self, $args) = @_;
my ($class, $columns) = @$args{qw(class columns)};
if ($class->isa('Bugzilla::Bug')) {
- push(@$columns, 'restrict_comments');
+ if (Bugzilla->dbh->bz_column_info($class->DB_TABLE, 'restrict_comments')) {
+ push @$columns, 'restrict_comments';
+ }
}
}
diff --git a/extensions/Review/Extension.pm b/extensions/Review/Extension.pm
index 406c29c7c..a918a5ca5 100644
--- a/extensions/Review/Extension.pm
+++ b/extensions/Review/Extension.pm
@@ -286,10 +286,14 @@ sub object_columns {
my ($self, $args) = @_;
my ($class, $columns) = @$args{qw(class columns)};
if ($class->isa('Bugzilla::Product')) {
- push @$columns, 'reviewer_required';
+ my $dbh = Bugzilla->dbh;
+ my @new_columns = qw(reviewer_required);
+ push @$columns, grep { $dbh->bz_column_info($class->DB_TABLE, $_) } @new_columns;
}
elsif ($class->isa('Bugzilla::User')) {
- push @$columns, qw(review_request_count feedback_request_count needinfo_request_count);
+ my $dbh = Bugzilla->dbh;
+ my @new_columns = qw(review_request_count feedback_request_count needinfo_request_count);
+ push @$columns, grep { $dbh->bz_column_info($class->DB_TABLE, $_) } @new_columns;
}
}
diff --git a/extensions/Review/bin/migrate_mentor_from_whiteboard.pl b/extensions/Review/bin/migrate_mentor_from_whiteboard.pl
index c6b69006f..debf173a7 100755
--- a/extensions/Review/bin/migrate_mentor_from_whiteboard.pl
+++ b/extensions/Review/bin/migrate_mentor_from_whiteboard.pl
@@ -36,7 +36,7 @@ EOF
<>;
# we need to be logged in to do user searching and update bugs
-my $nobody = Bugzilla::User->check({ name => 'nobody@mozilla.org' });
+my $nobody = Bugzilla::User->check({ name => Bugzilla->params->{'nobody_user'} });
$nobody->{groups} = [ Bugzilla::Group->get_all ];
Bugzilla->set_user($nobody);
diff --git a/extensions/Review/lib/WebService.pm b/extensions/Review/lib/WebService.pm
index 3f6816916..0c54d725a 100644
--- a/extensions/Review/lib/WebService.pm
+++ b/extensions/Review/lib/WebService.pm
@@ -51,7 +51,7 @@ sub suggestions {
# we always need to be authentiated to perform user matching
my $user = Bugzilla->user;
if (!$user->id) {
- Bugzilla->set_user(Bugzilla::User->check({ name => 'nobody@mozilla.org' }));
+ Bugzilla->set_user(Bugzilla::User->check({ name => Bugzilla->params->{'nobody_user'} }));
push @reviewers, @{ $bug->mentors };
Bugzilla->set_user($user);
} else {
diff --git a/extensions/SecureMail/Extension.pm b/extensions/SecureMail/Extension.pm
index 508b1f5e8..2b5e1bdd6 100644
--- a/extensions/SecureMail/Extension.pm
+++ b/extensions/SecureMail/Extension.pm
@@ -104,7 +104,10 @@ sub object_columns {
my $columns = $args->{'columns'};
if ($class->isa('Bugzilla::Group')) {
- push(@$columns, 'secure_mail');
+ my $dbh = Bugzilla->dbh;
+ if ($dbh->bz_column_info($class->DB_TABLE, 'secure_mail')) {
+ push @$columns, 'secure_mail';
+ }
}
}
diff --git a/extensions/TagNewUsers/Extension.pm b/extensions/TagNewUsers/Extension.pm
index b94873979..1810f204f 100644
--- a/extensions/TagNewUsers/Extension.pm
+++ b/extensions/TagNewUsers/Extension.pm
@@ -123,7 +123,9 @@ sub object_columns {
my ($self, $args) = @_;
my ($class, $columns) = @$args{qw(class columns)};
if ($class->isa('Bugzilla::User')) {
- push(@$columns, qw(comment_count creation_ts first_patch_bug_id));
+ my $dbh = Bugzilla->dbh;
+ my @new_columns = qw(comment_count creation_ts first_patch_bug_id);
+ push @$columns, grep { $dbh->bz_column_info($class->DB_TABLE, $_) } @new_columns;
}
}
@@ -131,9 +133,14 @@ sub object_before_create {
my ($self, $args) = @_;
my ($class, $params) = @$args{qw(class params)};
if ($class->isa('Bugzilla::User')) {
- my ($timestamp) = Bugzilla->dbh->selectrow_array("SELECT NOW()");
- $params->{comment_count} = 0;
- $params->{creation_ts} = $timestamp;
+ my $dbh = Bugzilla->dbh;
+ my ($timestamp) = $dbh->selectrow_array("SELECT NOW()");
+ if ($dbh->bz_column_info($class->DB_TABLE, 'comment_count')) {
+ $params->{comment_count} = 0;
+ }
+ if ($dbh->bz_column_info($class->DB_TABLE, 'creation_ts')) {
+ $params->{creation_ts} = $timestamp;
+ }
} elsif ($class->isa('Bugzilla::Attachment')) {
if ($params->{ispatch} && !Bugzilla->user->first_patch_bug_id) {
Bugzilla->user->first_patch_bug_id($params->{bug}->id);
diff --git a/extensions/TrackingFlags/bin/bug_825946.pl b/extensions/TrackingFlags/bin/bug_825946.pl
index 3f380b7ac..896dc5448 100755
--- a/extensions/TrackingFlags/bin/bug_825946.pl
+++ b/extensions/TrackingFlags/bin/bug_825946.pl
@@ -24,7 +24,7 @@ use Bugzilla::Bug qw(LogActivityEntry);
Bugzilla->usage_mode(USAGE_MODE_CMDLINE);
my $dbh = Bugzilla->dbh;
-my $user = Bugzilla::User->check({name => 'nobody@mozilla.org'});
+my $user = Bugzilla::User->check({name => Bugzilla->params->{'nobody_user'}});
my $tf_vis = $dbh->selectall_arrayref(<<SQL);
SELECT
diff --git a/extensions/TrackingFlags/bin/bulk_flag_clear.pl b/extensions/TrackingFlags/bin/bulk_flag_clear.pl
index 1745018d5..305fbf883 100755
--- a/extensions/TrackingFlags/bin/bulk_flag_clear.pl
+++ b/extensions/TrackingFlags/bin/bulk_flag_clear.pl
@@ -110,7 +110,7 @@ if (!$config->{update_db}) {
# update bugs
-my $nobody = Bugzilla::User->check({ name => 'nobody@mozilla.org' });
+my $nobody = Bugzilla::User->check({ name => Bugzilla->params->{'nobody_user'} });
# put our nobody user into all groups to avoid permissions issues
$nobody->{groups} = [Bugzilla::Group->get_all];
Bugzilla->set_user($nobody);
diff --git a/extensions/TrackingFlags/disabled b/extensions/TrackingFlags/disabled
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/extensions/TrackingFlags/disabled
diff --git a/extensions/UserProfile/Extension.pm b/extensions/UserProfile/Extension.pm
index 079f7a948..9171b942d 100644
--- a/extensions/UserProfile/Extension.pm
+++ b/extensions/UserProfile/Extension.pm
@@ -385,7 +385,9 @@ sub object_columns {
my ($self, $args) = @_;
my ($class, $columns) = @$args{qw(class columns)};
if ($class->isa('Bugzilla::User')) {
- push(@$columns, qw(last_activity_ts last_statistics_ts));
+ my $dbh = Bugzilla->dbh;
+ my @new_columns = qw(last_activity_ts last_statistics_ts);
+ push @$columns, grep { $dbh->bz_column_info($class->DB_TABLE, $_) } @new_columns;
}
}