Unsupported operand types in messaging module (fatal error on admin page)
On going to any edit a content type page
http://dev.example.com/admin/content/types/promo-badge
Fatal error: Unsupported operand types in /var/www/vhosts/dev.example.com/httpdocs/sites/all/modules/messaging/messaging.module on line 982
Which is the second-to-last line of this function of the messaging.module:
<?php
/**
* Helper function for mail methods
*
* This is the only non method agnostic functionality in this module. As there are several plug-ins
* for mail sending, we add this helper function here so its available for all them
*/
function messaging_mail_params($message, $params) {
// The message 'from' will depend on message sender if present
if (empty($params['from'])) {
if (!empty($message['sender_account']) && !empty($message['sender_account']->mail)) {
$params['from'] = check_plain($message['sender_account']->name) . ' <'.$message['sender_account']->mail.'>';
} elseif(!empty($message['sender_name']) && ($default_from = variable_get('site_mail', ini_get('sendmail_from')))) {
$params['from'] = check_plain($message['sender_name']) . ' <'.$default_from.'>';
}
}
// Fill in params with default values if not present
$params += array('from' => NULL, 'headers' => array(), 'mailkey' => 'message-'.$message['type']);
return $params;
}
?>
Which looks truly wrong. Can arrays really use the += operator? I think not: http://us.php.net/manual/en/language.operators.assignment.php
Resolution
... and then I realized I didn't end up using the messaging framework yet so I just disabled the module.
Comments
Post new comment