Report/SendEventErrors.php
authorAlan Knowles <alan@roojs.com>
Thu, 24 Mar 2016 04:07:33 +0000 (12:07 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 24 Mar 2016 04:07:33 +0000 (12:07 +0800)
Report/SendEventErrors.php

index bc49e2e..546a7cd 100644 (file)
@@ -158,7 +158,6 @@ class Pman_Admin_Report_SendEventErrors extends Pman_Roo
             $subject = "{$this->opts['subject']} $subject";
         }
         
-        $this->addEvent('ERROR-REPORT-' . $this->opts['uid'], false, $subject);
         
         $events = DB_DataObject::factory('Events');
         $events->autoJoin();
@@ -184,10 +183,14 @@ class Pman_Admin_Report_SendEventErrors extends Pman_Roo
             $events->whereAddIn('Events.action', $only, 'string');
         }
         
-        if(!$events->count()){
+        if(!$events->count()){  // this is the second count we are doing...
             $this->jerr('Nothing to be sent');
         }
         
+        
+        $this->addEvent('ERROR-REPORT-' . $this->opts['uid'], false, $subject);
+
+        
         $errors = $events->fetchAll();
         
         if(!empty($this->opts['host'])){