Hello there,
We are using Listhandler to integrate with our forums and provide information to our members to "daylight" our mailing lists. This is working really well to receive emails but with the latest release I encountered this error when trying to post a new entry:
recoverable fatal error: Object of class stdClass could not be converted to string in /disc2/rascwww/www/sites/all/modules/listhandler/listhandler.module on line 302.
I'm assuming that this has something to do with the way that the Forum module is formatting and presenting information to Listhandler that it isn't expecting. Can anyone provide insight as to the type and source of this error?
Thanks!
Denis Grey
Royal Astronomical Society of Canada
Comments
Comment #1
pilot7 commentedI am experiencing the same problem and need to resolve it. Line 302 of the List handler code is marked below with the comment, "Error thrown on this line". This might be a PHP 5.3 issue, as it was not a problem before I upgraded to a new server that had PHP 5.3. Any thoughts on how to solve this?
- Steve
/**
* Send email to mailing list.
* Includes a References/In_reply-To header if possible.
*/
function listhandler_send_mail($edit) {
global $user, $base_url, $language;
if (!$user->uid) {
$edit['name'] = variable_get('anonymous', 'Anonymous');
$edit['mail'] = variable_get('listhandler_from', '');
}
else {
$edit["name"] = $user->name;
$edit["mail"] = $user->mail;
}
// Find the list to send to.
$mboxen = array();
// taxo terms of the node.
if (count($edit['taxonomy'])) {
foreach ($edit['taxonomy'] as $taxoterm) {
// Now for the mailbox.
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
$result2 = db_query("SELECT * FROM {mailhandler} m WHERE m.commands REGEXP '%s'", 'tid:[[:blank:]]*'. $taxoterm .'[[:>:]]'); // ***************** ERROR THROWN ON THIS LINE
break;
case 'pgsql':
$result2 = db_query("SELECT * FROM {mailhandler} m WHERE m.commands ~ '%s'", 'tid:[[:blank:]]*'. $taxoterm .'[[:>:]]');
}
while ($mbox = db_fetch_object($result2)) {
$mboxen[] = array($mbox->mid, $mbox->mailto, $taxoarr->tid);
}
}
}
Comment #2
chrisfromredfinI haven't yet set up a local sandbox to test this full integration. my initial hunch is that you need to change $taxoterm to $taxoterm->tid (so the line goes from)
to
Can you let me know if that helps? (It may fix this error but spawn future ones... ;) )
Comment #3
pilot7 commentedAwesome! -- As far as I can tell, this fixed the Listhandler issue. Posts to the forum are now being sent via email. I will let you know if anything comes up.
- Steve
Comment #4
chrisfromredfingreat I'll try and roll this into at least the -dev version.
Comment #5
pilot7 commentedI did not notice this before, but we have found a new problem that started when this fix was made. While new posts are being emailed out correctly, they do not get an entry in og_ancestry. This is causing other queries to fail that rely on entries in og_ancestry. (new posts seem tied to the group through the taxonomy term but not through the og_ancestry.)