I have Message and Commerce Message installed and working fine. However, on our dev site, when trying to run cron, it throws this error and stops cron from finishing:

PHP Fatal error: Unsupported operand types in /home/devel/public_html/sites/all/modules/message/message.module on line 295

That line and the function is:

  // Gather purgeable messages of overriding types.
  foreach ($override_types as $message_type) {
    // Ignore message type with unchecked "Purge messages". Also make sure that
    // purging settings are present.
    if (empty($message_type->data['purge']) || empty($message_type->data['purge']['enabled'])) {
      continue;
    }

    $purge_messages += message_get_purgeable_by_type($purge_limit, $message_type->name, $message_type->data['purge']); //Line 295
  }

I think this might be caused by checking "Override" and "Purge Messages", but not putting anything in the field. In that case, it does not return an array.

function message_get_purgeable_by_type(&$purge_limit, $message_type_name, $purge_settings) {
  if ($purge_limit <= 0) {
    return;
  }

...
..

If you change it to:

function message_get_purgeable_by_type(&$purge_limit, $message_type_name, $purge_settings) {
  if ($purge_limit <= 0) {
    return array();
  }

...
..

It seems to work fine.

Files: 
CommentFileSizeAuthor
#2 fix-cron-purge-messages-error-2030101-2.patch391 bytesantondavidsen
PASSED: [[SimpleTest]]: [MySQL] 69 pass(es).
[ View ]

Comments

amitaibu’s picture

How about a patch? :)

antondavidsen’s picture

Issue summary:View changes
StatusFileSize
new391 bytes
PASSED: [[SimpleTest]]: [MySQL] 69 pass(es).
[ View ]

Patch against 1.9

amitaibu’s picture

Version:7.x-1.8» 7.x-1.x-dev
Status:Active» Needs review

Correct status and version.