[bugzilla-gnome-org-extensions] patch report: Check for GnomeAttachmentStatus during checksetup



commit da544161b923a36b3e4dce0ab7a60e92a4753c59
Author: Krzesimir Nowak <qdlacz gmail com>
Date:   Thu Nov 6 22:46:35 2014 +0100

    patch report: Check for GnomeAttachmentStatus during checksetup
    
    Better to bail out then instead of getting some error after
    deployment.

 PatchReport/Extension.pm                           |   17 ++++++++++++++
 PatchReport/lib/Util.pm                            |    5 ----
 .../hook/global/code-error-errors.html.tmpl        |   24 --------------------
 3 files changed, 17 insertions(+), 29 deletions(-)
---
diff --git a/PatchReport/Extension.pm b/PatchReport/Extension.pm
index d7f4d9f..90c885c 100644
--- a/PatchReport/Extension.pm
+++ b/PatchReport/Extension.pm
@@ -13,5 +13,22 @@ sub page_before_template {
     
 }
 
+sub install_before_final_checks {
+    my ($self) = @_;
+    my $extensions = Bugzilla->extensions();
+    my $extension_name = 'Bugzilla::Extension::GnomeAttachmentStatus';
+    my $found_attachment_status_extension = undef;
+
+    for my $extension (@{$extensions}) {
+        if ($extension->isa($extension_name)) {
+            $found_attachment_status_extension = 1;
+            last;
+        }
+    }
+
+    unless ($found_attachment_status_extension) {
+        die __PACKAGE__->NAME . ' extension requires ' . $extension_name . ' extension';
+    }
+}
 
 __PACKAGE__->NAME;
diff --git a/PatchReport/lib/Util.pm b/PatchReport/lib/Util.pm
index a5119dc..f3c185d 100644
--- a/PatchReport/lib/Util.pm
+++ b/PatchReport/lib/Util.pm
@@ -46,11 +46,6 @@ sub _page_patch_report {
     my $min_days = -1;    # (int) Don't show patches younger than this (in days)
     my $max_days = -1;    # (int) Don't show patches older than this (in days)
     my $submitter;        # (int) submitter id
-
-    if (!$dbh->bz_column_info('attachments', 'gnome_attachment_status')) {
-        ThrowCodeError('patchreport_no_attachments_status')
-    }
-
     my @products = $cgi->param('product');
     my @components = $cgi->param('component');
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]