Ignore BRE.id = -1.
authorJason Stephenson <jstephenson@mvlc.org>
Thu, 3 Oct 2013 14:28:37 +0000 (10:28 -0400)
committerJason Stephenson <jstephenson@mvlc.org>
Tue, 4 Feb 2014 17:55:41 +0000 (12:55 -0500)
Add to the where condition in Marque::Biblio::build_query to make
sure that bre.id > 0.

Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Open-ILS/src/support-scripts/Marque.pm.in

index 36ac1cd..8e5ab93 100644 (file)
@@ -388,14 +388,14 @@ ACN_JOIN
     }
 
     # The where really depends on a few options:
-    my $where = 'where ';
+    my $where = "where $breTable.id > 0 and ";
     # We fill in the where as necessary.
     if ($self->{idlist} && @{$self->{idlist}}) {
         $where .= "$breTable.id in (" . join(',', @{$self->{idlist}}) . ')';
     } elsif ($Marque::config->option_value('since')) {
         my $since_str = Marque::Connector::db_date($self->{since_date});
-        $where .= "$breTable.edit_date > '$since_str'";
-        $where .= " or $breTable.create_date > '$since_str'";
+        $where .= "($breTable.edit_date > '$since_str'";
+        $where .= " or $breTable.create_date > '$since_str')";
     } else {
         # We want all non-deleted records.
         $where .= "$breTable.deleted = 'f'";