}
}
+sub sanitycheck_check {
+ my ($self, $args) = @_;
+
+ my $dbh = Bugzilla->dbh;
+ my $status = $args->{'status'};
+ $status->('bmo_check_cf_visible_in_products');
+
+ my $products = $dbh->selectcol_arrayref('SELECT name FROM products');
+ my %product = map { $_ => 1 } @$products;
+ my @cf_products = map { keys %$_ } values %$cf_visible_in_products;
+ foreach my $cf_product (@cf_products) {
+ $status->('bmo_check_cf_visible_in_products_missing',
+ { cf_product => $cf_product }, 'alert') unless $product{$cf_product};
+ }
+}
+
sub db_sanitize {
print "deleting reporter's user-agents...\n";
Bugzilla->dbh->do("TRUNCATE TABLE bug_user_agent");
"Android Background Services" => [],
"B2GDroid" => [],
"Calendar" => [],
- "Camino" => [],
"Composer" => [],
"Core" => [],
"Directory" => [],
- "Fennec" => [],
+ "External Software Affecting Firefox" => [],
"Firefox" => [],
"Firefox for Android" => [],
"Firefox for Metro" => [],
"NSS" => [],
"Other Applications" => [],
"Penelope" => [],
- "Plugins" => [],
"Release Engineering" => [],
"Rhino" => [],
"SeaMonkey" => [],
--- /dev/null
+[%# 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.
+ #%]
+
+[% IF san_tag == "bmo_check_cf_visible_in_products" %]
+ Checking $cf_visibile_in_products for missing product names.
+
+[% ELSIF san_tag == "bmo_check_cf_visible_in_products_missing" %]
+ ... there are custom fields for [% cf_product FILTER html %] but it does not exist!
+
+[% END %]
\ No newline at end of file
my $cgi = Bugzilla->cgi;
my $dbh = Bugzilla->dbh;
+my $hooks_only = $cgi->param('hooks_only');
# If the result of the sanity check is sent per email, then we have to
# take the user prefs into account rather than querying the web browser.
my $template;
# Only check the token if we are running this script from the
# web browser and a parameter is passed to the script.
# XXX - Maybe these two parameters should be deleted once logged in?
- $cgi->delete('GoAheadAndLogIn', 'Bugzilla_restrictlogin');
+ $cgi->delete('GoAheadAndLogIn', 'Bugzilla_restrictlogin', 'hooks_only');
if (scalar($cgi->param())) {
my $token = $cgi->param('token');
check_hash_token($token, ['sanitycheck']);
|| ThrowTemplateError($template->error());
}
+goto REPAIR_HOOKS if $hooks_only;
+
###########################################################################
# Create missing group_control_map entries
###########################################################################
# Repair hook
###########################################################################
+REPAIR_HOOKS:
+
Bugzilla::Hook::process('sanitycheck_repair', { status => \&Status });
+goto CHECK_HOOKS if $hooks_only;
###########################################################################
# Checks
###########################################################################
###########################################################################
# Check hook
###########################################################################
-
+CHECK_HOOKS:
Bugzilla::Hook::process('sanitycheck_check', { status => \&Status });
###########################################################################