]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 150105: $debug flag in buglist.cgi not working - Patch by Teemu Mannermaa <wicked...
authorlpsolit%gmail.com <>
Wed, 26 Oct 2005 23:52:18 +0000 (23:52 +0000)
committerlpsolit%gmail.com <>
Wed, 26 Oct 2005 23:52:18 +0000 (23:52 +0000)
Bugzilla/Search.pm
buglist.cgi
template/en/default/list/list.html.tmpl
template/en/default/list/server-push.html.tmpl

index 5a651a3b519695aa02700a86333c26160afc1098..ebccdb51e08e3d6bfb5d6c07575da06853212596 100644 (file)
@@ -102,6 +102,8 @@ sub init {
     my @orderby;
 
     my $debug = 0;
+    my @debugdata;
+    if ($params->param('debug')) { $debug = 1; }
 
     my @fields;
     my @supptables;
@@ -1160,7 +1162,9 @@ sub init {
             $params->param("type$chart-$row-$col", shift(@$ref));
             $params->param("value$chart-$row-$col", shift(@$ref));
             if ($debug) {
-                print qq{<p>$params->param("field$chart-$row-$col") | $params->param("type$chart-$row-$col") | $params->param("value$chart-$row-$col")*</p>\n};
+                push(@debugdata, "$row-$col = " .
+                               $params->param("field$chart-$row-$col") . ' | ' .                               $params->param("type$chart-$row-$col") . ' | ' .
+                               $params->param("value$chart-$row-$col") . ' *');
             }
             $col++;
 
@@ -1298,7 +1302,7 @@ sub init {
                     if ("$f,$t,$rhs" =~ m/$key/) {
                         my $ref = $funcsbykey{$key};
                         if ($debug) {
-                            print "<p>$key ($f , $t , $rhs ) => ";
+                            push(@debugdata, "$key ($f / $t / $rhs) =>");
                         }
                         $ff = $f;
                         if ($f !~ /\./) {
@@ -1306,7 +1310,8 @@ sub init {
                         }
                         &$ref;
                         if ($debug) {
-                            print "$f , $t , $v , $term</p>";
+                            push(@debugdata, "$f / $t / $v / " .
+                                             ($term || "undef") . " *");
                         }
                         if ($term) {
                             last;
@@ -1436,12 +1441,8 @@ sub init {
         $query .= " ORDER BY " . join(',', @orderby);
     }
 
-    if ($debug) {
-        print "<p><code>" . value_quote($query) . "</code></p>\n";
-        exit;
-    }
-    
     $self->{'sql'} = $query;
+    $self->{'debugdata'} = \@debugdata;
 }
 
 ###############################################################################
@@ -1601,6 +1602,11 @@ sub getSQL {
     return $self->{'sql'};
 }
 
+sub getDebugData {
+    my $self = shift;
+    return $self->{'debugdata'};
+}
+
 sub pronoun {
     my ($noun, $user) = (@_);
     if ($noun eq "%user%") {
index cb49d2a312e04f01d1599f96aa337cdd1945157f..386253556173dfac1db3283759c8547cf2e8b442 100755 (executable)
@@ -847,6 +847,7 @@ elsif ($fulltext) {
 if ($cgi->param('debug')) {
     $vars->{'debug'} = 1;
     $vars->{'query'} = $query;
+    $vars->{'debugdata'} = $search->getDebugData();
 }
 
 # Time to use server push to display an interim message to the user until
index 48b60ac8ae34cd76fdb7ac8c0a2407037c28987e..5c2e0312a098adaa6062074096f96f760681b192 100644 (file)
   [% END %]\r
 
   [% IF debug %]
+    <p>
+      [% FOREACH debugline = debugdata %]
+        [% debugline FILTER html %]<br>
+      [% END %]
+    </p>
     <p>[% query FILTER html %]</p>
   [% END %]
 
index 4fb88e9b441656005fa888674730519344290a32..be7a63c56e68d65312d3f7e8366925217bab7a03 100644 (file)
     <h1 style="margin-top: 20%; text-align: center;">Please stand by ...</h1>
 
     [% IF debug %]
+      <p>
+        [% FOREACH debugline = debugdata %]
+          <code>[% debugline FILTER html %]</code><br>
+        [% END %]
+      </p>
       <p>
         <code>[% query FILTER html %]</code>
       </p>