Closed (fixed)
Project:
Mailing List Archive
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Dec 2007 at 02:30 UTC
Updated:
24 Dec 2007 at 16:41 UTC
The stock mailarchive_stats.module complains when there are no subscriptions set up:
warning: Invalid argument supplied for foreach() in /Users/sean/svn/mailarchive/mailarchive_stats/mailarchive_stats.module on line 168.
To fix this, $statistics must be declared. Here's a patch:
Index: mailarchive_stats.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mailarchive/mailarchive_stats/mailarchive_stats.module,v
retrieving revision 1.6
diff -u -r1.6 mailarchive_stats.module
--- mailarchive_stats.module 16 Nov 2007 02:36:36 -0000 1.6
+++ mailarchive_stats.module 10 Dec 2007 02:24:45 -0000
@@ -119,6 +119,7 @@
$hour = date('YmdH', $now);
$lasthour = date('YmdH', $now - 3600);
+ $statistics = array();
$result = db_query('SELECT sid, nid, urlname, subscription_status, message_count, last_message FROM {mailarchive_subscriptions}');
while ($subscription = db_fetch_object($result)) {
// All time statistics.
Comments
Comment #1
jeremy commentedThanks for the bug report. Fix committed. I added a friendly message if no subscriptions are created.
Comment #2
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.