patch for bug-3017
authorMason James <mason.loves.sushi@gmail.com>
Mon, 9 Mar 2009 02:13:06 +0000 (15:13 +1300)
committerGalen Charlton <galen.charlton@liblime.com>
Sat, 4 Apr 2009 00:53:16 +0000 (19:53 -0500)
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
C4/Reports/Guided.pm

index 5df6c2a..0e4f418 100644 (file)
@@ -483,7 +483,7 @@ Given some sql and a name this will saved it so that it can resued
 sub save_report {
     my ( $sql, $name, $type, $notes ) = @_;
     my $dbh = C4::Context->dbh();
-    $sql =~ s/(\W*)$//;
+    $sql =~ s/(\s*\;\s*)$//; # removes trailing whitespace and /;/
     my $query =
 "INSERT INTO saved_sql (borrowernumber,date_created,last_modified,savedsql,report_name,type,notes)  VALUES (?,now(),now(),?,?,?,?)";
     my $sth = $dbh->prepare($query);