User login

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.

Searched words: 
Unsupported operand types messaging.module drupal

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.