Hello -
My goal is to expand event logging information a bit with just enough human
readable context that an external version of the standard log table can be used to create simple
human-readable reports on the external site without the complication of exporting extra tables. To do that all I need to add, for example, is a course name to the 'other' field array when someone triggers the course_viewed event. It seemed to me that the init() portion of the course_viewed subclass would have been the logical place to put this since init() is called by base during the creation function specifically to place initial data (in this case, crud and level) that is unique into the calling event's data list. However, nothing I've tried so far works.
Right now I'm editing the course_viewed.php file directly, just to see if I can get it to work, with plans to move it to a plugin once it functions. This is the gist of what I've been trying to do:
protected function init() {$this->data['crud'] = 'r';
$this->data['edulevel'] = self::LEVEL_PARTICIPATING;
$this->data['other'] = 'test course name';
}
I've also tried creating an "other" array and assigning 'coursename' => "test course name" and then assigning that to $this->data['other'], and many other variations on that theme. Nada. I still get a null "other" entry in the standard log table for that event when it gets passed to base for event creation. (Base doesn't even seem to see the other entry at all, so it gets set to null...)
So, I've not hit on the right format, or maybe I am barking up the wrong tree on the correct place/time to add this to an event. Ideas? Pointers?
thank you to anyone who can give me a push here!