fix thinko on granularity filter -- granularity is on the defintion, not the event
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 5 Nov 2009 20:29:40 +0000 (20:29 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 5 Nov 2009 20:29:40 +0000 (20:29 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@14794 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Trigger.pm

index 15797ae..0fa0fb0 100644 (file)
@@ -525,12 +525,12 @@ sub pending_events {
 
     my $editor = new_editor();
 
-    my $query = [{ state => 'pending', run_time => {'<' => 'now'} }, { order_by => { atev => [ qw/run_time add_time/] } }];
+    my $query = [{ state => 'pending', run_time => {'<' => 'now'} }, { order_by => { atev => [ qw/run_time add_time/] }, 'join' => 'atevdef' }];
 
     if (defined $granularity) {
-        $query->[0]->{'-or'} = [ {granularity => $granularity}, {granularity => undef} ];
+        $query->[0]->{'+atevdef'} = {'-or' => [ {granularity => $granularity}, {granularity => undef} ] };
     } else {
-        $query->[0]->{granularity} = undef;
+        $query->[0]->{'+atevdef'} = {granularity => undef};
     }
 
     return $editor->search_action_trigger_event(