setting up EVENTS module?

I would like to toy a bit further with the EVENTS module, but I can't seem to get it working. I installed emoncms v5 in a fresh folder on my hosted domain, created a new database for it and copied the files to /modules folder. A new menu "Extras" has appeared. I entered my gmail SMTP setting and set up couple test triggers. However, they don't seem to ever trigger, is there a cron job to setup or anything else that needs to be done so that the events work?

 

Mattia Rossi's picture

Re: setting up EVENTS module?

Hi,

until trystan merges in a pull enabling it you will have to apply this patch:

 

diff --git a/Modules/feed/feed_model.php b/Modules/feed/feed_model.php
index f6db96c..4d34a7e 100644
--- a/Modules/feed/feed_model.php
+++ b/Modules/feed/feed_model.php
@@ -275,11 +275,12 @@ class Feed
     $updatetime = date("Y-n-j H:i:s", $updatetime);
     $this->mysqli->query("UPDATE feeds SET value = '$value', time = '$updatetime' WHERE id='$feedid'");

-    // Check feed event if event module is installed
-    // if (is_dir(realpath(dirname(__FILE__)).'/../event/')) {
-    //    require_once(realpath(dirname(__FILE__)).'/../event/event_model.php');
-    //    check_feed_event($feedid,$updatetime,$feedtime,$value);
-    // }
+    //Check feed event if event module is installed
+    if (is_dir(realpath(dirname(__FILE__)).'/../event/')) {
+      require_once(realpath(dirname(__FILE__)).'/../event/event_model.php');
+      $event = new Event($this->mysqli);
+      $event->check_feed_event($feedid,$updatetime,$feedtime,$value);
+    }

     return $value;
   }
@@ -307,11 +308,12 @@ class Feed
     $updatetime = date("Y-n-j H:i:s", $updatetime);
     $this->mysqli->query("UPDATE feeds SET value = '$value', time = '$updatetime' WHERE id='$feedid'");

-    // Check feed event if event module is installed
-    // if (is_dir(realpath(dirname(__FILE__)).'/../event/')) {
-    //    require_once(realpath(dirname(__FILE__)).'/../event/event_model.php');
-    //    check_feed_event($feedid,$updatetime,$feedtime,$value);
-    // }
+    //Check feed event if event module is installed
+    if (is_dir(realpath(dirname(__FILE__)).'/../event/')) {
+      require_once(realpath(dirname(__FILE__)).'/../event/event_model.php');
+      $event = new Event($this->mysqli);
+      $event->check_feed_event($feedid,$updatetime,$feedtime,$value);
+    }

     return $value;
   }

 

to feed_model.php, otherwise the event check won't be triggered when feeds update

 

Regards

mharizanov's picture

Re: setting up EVENTS module?

That did the trick. Thanks!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.