[bugzilla-gnome-org-extensions] Fix the "Continue to File this Bug" button.



commit e73efd15f00acbc69425f7eac4e99d0011ca22ac
Author: Max Kanat-Alexander <mkanat everythingsolved com>
Date:   Mon Aug 17 16:13:38 2009 -0500

    Fix the "Continue to File this Bug" button.

 lib/TraceParser/Hooks.pm                           |    5 ++++-
 .../en/default/trace/possible-duplicate.html.tmpl  |   15 ++++++++-------
 2 files changed, 12 insertions(+), 8 deletions(-)
---
diff --git a/lib/TraceParser/Hooks.pm b/lib/TraceParser/Hooks.pm
index f9732ae..dfbdf98 100644
--- a/lib/TraceParser/Hooks.pm
+++ b/lib/TraceParser/Hooks.pm
@@ -58,7 +58,6 @@ sub bug_create {
 
 sub _check_duplicate_trace {
     my ($trace, $bug, $comment) = @_;
-    my $cgi = Bugzilla->cgi;
     my $dbh = Bugzilla->dbh;
     my $template = Bugzilla->template;
     my $user = Bugzilla->user;
@@ -68,6 +67,10 @@ sub _check_duplicate_trace {
         _handle_dup_to($trace, $dup_to, $comment);
     }
 
+    return if Bugzilla->usage_mode != USAGE_MODE_BROWSER;
+    my $cgi = Bugzilla->cgi;
+    return if $cgi->param('traceparser_skip_duplicate');
+
     my @identical = grep { $_->is_visible } @{ $trace->identical_traces };
     my @similar   = grep { $_->is_visible } @{ $trace->similar_traces };
     if (@identical or @similar) {
diff --git a/template/en/default/trace/possible-duplicate.html.tmpl 
b/template/en/default/trace/possible-duplicate.html.tmpl
index bed5844..60109ac 100644
--- a/template/en/default/trace/possible-duplicate.html.tmpl
+++ b/template/en/default/trace/possible-duplicate.html.tmpl
@@ -78,14 +78,15 @@
 
 <form id="create" method="POST" action="post_bug.cgi"
   [%- IF Bugzilla.cgi.param("data") %] enctype="multipart/form-data"[% END %]>
-    <input type="hidden" name="ignore_token" value="[% bugid FILTER html %]">
+  <input type="hidden" name="ignore_token" value="[% bugid FILTER html %]">
+  <input type="hidden" name="traceparser_skip_duplicate" value="1">
 
-    <p>If none of the above [% terms.bugs %] look like the bug
-      you are trying to file, then 
-      <input type="submit" id="file_bug_again" 
-             value="Continue to File This [% terms.Bug %]"></p>
-    [% PROCESS "global/hidden-fields.html.tmpl"
-               exclude="^(Bugzilla_login|Bugzilla_password|ignore_token)$" %]
+  <p>If none of the above [% terms.bugs %] look like the bug
+    you are trying to file, then 
+    <input type="submit" id="file_bug_again" 
+           value="Continue to File This [% terms.Bug %]"></p>
+  [% PROCESS "global/hidden-fields.html.tmpl"
+             exclude="^(Bugzilla_login|Bugzilla_password|ignore_token)$" %]
 </form>
 
 [% PROCESS global/footer.html.tmpl %]


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