Toni - I have installed the RC version. I have debugging set to show all errors and I did receive a PHP Notice:
Notice: Undefined property: stdClass::$id in /home/arborrow/Moodle/code/19stable/blocks/email_list/email/lib.php on line 2376
when I created a block on the front page.
Further information found includes:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND s.readed = 0' at line 7
SELECT count
FROM mdl_email_mail m LEFT JOIN mdl_email_send s ON m.id = s.mailid LEFT JOIN mdl_email_foldermail fm ON m.id = fm.mailid WHERE s.userid = 2 AND s.course = 7 AND fm.folderid = AND s.readed = 0
- line 686 of lib/dmllib.php: call to debugging()
- line 379 of lib/dmllib.php: call to get_recordset_sql()
- line 2379 of blocks/email_list/email/lib.php: call to count_records_sql()
- line 78 of blocks/email_list/block_email_list.php: call to email_get_number_unreaded()
- line 814 of blocks/moodleblock.class.php: call to block_email_list->get_content()
- line 822 of blocks/moodleblock.class.php: call to block_list->is_empty()
- line 338 of lib/blocklib.php: call to block_list->_print_block()
- line 267 of index.php: call to blocks_print_group()
Looks like the value for the fm.folderid = part did not get passed into the sql statement.
You may want to do something like:
if (!empty($folder->id)) {
$wheresql = " WHERE s.userid = $userid
AND s.course = $courseid
AND fm.folderid = $folder->id
AND s.readed = 0";
} else {
$wheresql = " WHERE s.userid = $userid
AND s.course = $courseid
AND s.readed = 0";
}
just to make sure that you do not get an error when there is no $folder->id.
When I tried to create a new email (after adding the check above) I received:
Notice: Trying to get property of non-object in /home/arborrow/Moodle/code/19stable/blocks/email_list/email/mail_edit_form.php on line 61
Again, I would replace that with:
if (!empty($oldmail->id)) {
$mform->addElement('hidden', 'id', $oldmail->id);
}
In general I would encourage you to do a little more checking and testing with debugging mode on to help avoid these types of notices. I'll go ahead and upload the code. Some of these will serve as nice simple corrections to test your CVS access. Let me know if you have any questions and thanks for your willingness to share you time, talent, and code with the Moodle community.
Peace - Anthony
Anthony, this is a Plugin. View discussion: http://moodle.org/mod/forum/discuss.php?d=65462