Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Duplicate
-
Affects Version/s: 1.9.3
-
Fix Version/s: None
-
Component/s: Forum
-
Labels:None
-
Environment:n/a
-
Database:MySQL
-
Difficulty:Difficult
-
Affected Branches:MOODLE_19_STABLE
Description
I have a client site that was upgraded from 1.8.2+ to 1.9.3+. After this upgrade, email is not being sent from forums. Debugging notes:
- All my other 1.9.3+ sites running the same codebase are sending forum email just fine
- Email for the rest of the site works fine (e.g. Messaging, self-enrollment)
I get an error, with debug set to all, as follows:
Catchable fatal error</b>: Object of class stdClass could not be converted to string in <b>/path/to/moodle/lib/dmllib.php</b> on line <b>2219</b>
// (the line number might be incorrect!!)
That error is within the function where_clause() which expects only string value params.
It turns out that on approximately line 292 of /mod/forum/lib.php, there is a call to get_context_instance() as follows:
...
if ($subusers = forum_subscribed_users($courses[$courseid], $forums[$forumid], 0,
get_context_instance(CONTEXT_MODULE, $coursemodules[$forumid]->instance))) { // THIS IS THE LINE
foreach ($subusers as $postuser) {
...
But $coursemodules[$forumid] on that line is an Object and the where_clause() poops out because of it.
I haven't as yet tracked down a fix; I also haven't tracked down the ultimate cause. Also, since 1.9.3+ sites on the same codebase are sending email fine, I 'm reasonably sure that the upgrade is the root of the problem somewhere.
I'll report back more details as I get them. Thank you!
Issue Links
| This issue duplicates: | ||||
| MDL-17673 | No emails sent after upgrading to 1.9.3, I had to downgrade |
|
|
|
Hi, can you make sure you are using a recent weekly version? I think this regression was fixed shortly before Xmas.