diff --git a/notifications.event.inc b/notifications.event.inc index eaa5ded..903276d 100644 --- a/notifications.event.inc +++ b/notifications.event.inc @@ -529,7 +529,7 @@ class Notifications_Event extends Notifications_Entity { $message = $template->build_message(); $message->add_event($this, array_keys($subscriptions)); // Keep track of users sent so we don't repeat - $results = array('skip' => array(), 'sent' => array(), 'success' => array(), 'error' => array()); + $results = array('skip' => array(), 'sent' => array(), 'success' => 0, 'error' => array()); foreach ($subscriptions as $subscription) { $this->last_sid = $subscription->sid; if ($destination = $subscription->get_destination()) { @@ -540,8 +540,7 @@ class Notifications_Event extends Notifications_Entity { } // Mark the event as already sent for this destination $this->notifications_sent[$destination->index()] = TRUE; - } - else { + } else { // Missing or wrong destination watchdog('notifications', 'Cannot find destination or missing user for subscription @sid', array('@sid' => $subscription->sid), WATCHDOG_WARNING); } @@ -550,9 +549,8 @@ class Notifications_Event extends Notifications_Entity { $this->notif_sent++; $message->add_destination($destination, $subscription->send_method); $results['sent'][] = $subscription->sid; - } - else { - $this->notif_error++; + } else { + $this->notif_errors++; $results['error'][] = $subscription->sid; } }