Unsupported operand types in messaging module (fatal error on admin page)

By Benjamin Melançon
on 12 Aug
0 comments

Key words and phrases

Unsupported operand types messaging.module drupal

Tags

Description

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.

 

Post new comment
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <h1> <h2> <h3> <h4> <h5> <h6> <small> <pre> <strike> <sub> <sup> <kbd> <s>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.