Here is one example of a question and response related to this moodle report development.
After deploying the report to production, I noticed the error log for the moodle instance was growing. I opened the log and saw repeatedly that each time my report was requested it was causing an offset error in the log, like this:
[Fri Nov 16 09:37:37 2012] [error] [client 10.3.12.40] PHP Notice: Undefined offset: 1 in C:\\wamp\\www\\rd\\report\\studentprogress\\dbfunctions.php on line 55, referer: http://10.2.28.7/rd/report/studentprogress/index.php
After a bit more due dillegence, I added a check for a null value around the offending code, like this:
//if the struct is not empty, send back just the total time for each date
if(! empty($struct) ){
return $struct[$i]['totalweeklytime'];
}else{
return null;
}
This was not a fatal error and did not show itself when viewing the report in a browser. I should have been checking the error log more closely on my development instance before I deployed the plugin to production! On my development instance, i have errors reporting to the log file and not to the screen. Check moodle Settings|Development|Debugging. This is how i missed this.
Thanks for sharing the solution with us...
ReplyDeleteCakephp Development Company
Funny, I looked at this post today which mentions checking the error logs with frequency. I am working on another piece which has been quietly writing an error over and over to the log file. It does not fail in the application and I am developing/testing on my live server, shame on me. If I was doing this work in my RD instance, where the debugging is set to the screen, and not the log file, I would have seen it sooner. Thanks and oops!
ReplyDelete