[Rt-commit] rt branch, 4.0/report-ticketsql-errors, updated. rt-4.0.11rc1-28-gcf0a919

Thomas Sibley trs at bestpractical.com
Thu May 9 20:16:59 EDT 2013


The branch, 4.0/report-ticketsql-errors has been updated
       via  cf0a9196867078451acf2e01f9125559305735b2 (commit)
       via  b5711f117310ea4dffdb7f08a604b6c4623e7b5d (commit)
       via  dc9d249ebf19d08643b0346d53c3e28cf0bba548 (commit)
      from  bbbff09492490ef1e723c0d610838cee92f3cb78 (commit)

Summary of changes:
 lib/RT/Tickets_SQL.pm          | 2 +-
 share/html/Search/Results.html | 9 ++++++---
 2 files changed, 7 insertions(+), 4 deletions(-)

- Log -----------------------------------------------------------------
commit dc9d249ebf19d08643b0346d53c3e28cf0bba548
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Thu May 9 15:51:01 2013 -0700

    Remove the query from the error message FromSQL reports
    
    It is already included in the RT::SQL generated errors.

diff --git a/lib/RT/Tickets_SQL.pm b/lib/RT/Tickets_SQL.pm
index 7d58242..d128c63 100644
--- a/lib/RT/Tickets_SQL.pm
+++ b/lib/RT/Tickets_SQL.pm
@@ -293,7 +293,7 @@ sub FromSQL {
     eval { $self->_parser( $query ); };
     if ( $@ ) {
         my $error = "$@";
-        $RT::Logger->error("Couldn't parse << $query >>: $error");
+        $RT::Logger->error("Couldn't parse query: $error");
         return (0, $error);
     }
 

commit b5711f117310ea4dffdb7f08a604b6c4623e7b5d
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Thu May 9 16:57:09 2013 -0700

    Don't bother rendering CollectionList when the query is unparseable
    
    Avoids a double error message in the logs.

diff --git a/share/html/Search/Results.html b/share/html/Search/Results.html
index 878c4f3..e1ddc33 100644
--- a/share/html/Search/Results.html
+++ b/share/html/Search/Results.html
@@ -55,7 +55,7 @@
 % unless ($ok) {
 %     $msg =~ s{ at .*? line .*}{}s;
 <p><&|/l_unsafe, "<i>".$m->interp->apply_escapes($msg, "h")."</i>" &>There was an error parsing your search query: [_1].  Your RT admin can find more information in the error logs.</&></p>
-% }
+% } else {
 
 <& /Elements/CollectionList, 
     Query => $Query,
@@ -70,6 +70,7 @@
     BaseURL => $BaseURL
 
    &>
+% }
 % $m->callback( ARGSRef => \%ARGS, CallbackName => 'AfterResults' );
 
 % my %hiddens = (Query => $Query, Format => $Format, Rows => $Rows, OrderBy => $OrderBy, Order => $Order, HideResults => $HideResults, Page => $Page, SavedChartSearchId => $SavedChartSearchId );

commit cf0a9196867078451acf2e01f9125559305735b2
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Thu May 9 17:14:45 2013 -0700

    Enclose the query parse error in a red error box
    
    For greater visibility that something ain't right.

diff --git a/share/html/Search/Results.html b/share/html/Search/Results.html
index e1ddc33..fb53c69 100644
--- a/share/html/Search/Results.html
+++ b/share/html/Search/Results.html
@@ -53,8 +53,10 @@
 % $m->callback( ARGSRef => \%ARGS, CallbackName => 'BeforeResults' );
 
 % unless ($ok) {
-%     $msg =~ s{ at .*? line .*}{}s;
-<p><&|/l_unsafe, "<i>".$m->interp->apply_escapes($msg, "h")."</i>" &>There was an error parsing your search query: [_1].  Your RT admin can find more information in the error logs.</&></p>
+%    $msg =~ s{ at .*? line .*}{}s;
+<&| /Widgets/TitleBox, title => loc("Error"), class => "error" &>
+<&|/l_unsafe, "<i>".$m->interp->apply_escapes($msg, "h")."</i>" &>There was an error parsing your search query: [_1].  Your RT admin can find more information in the error logs.</&>
+</&>
 % } else {
 
 <& /Elements/CollectionList, 

-----------------------------------------------------------------------


More information about the Rt-commit mailing list