It seems that the messaging_template_build function of the messaging_template module is missing a return statement.

For example, around line 131 of messaging_template.module, there is the following:

  $message = new Messaging_Message(array('subject' => $subject, 'body' => $text, 'language' => $language));
}

where i believe the intention is that it should do:

  $message = new Messaging_Message(array('subject' => $subject, 'body' => $text, 'language' => $language));

  return $message;
}
CommentFileSizeAuthor
#4 912322-4.patch570 bytesroderik
#2 912322.patch574 bytesroderik

Comments

jsmm’s picture

Hi. I had the same issue but it went away when I updated both messaging and notifications to version 6.x-4.0-beta7.

roderik’s picture

Status: Active » Needs review
StatusFileSize
new574 bytes

Uhm, no. It probably didn't, since the error is still in CVS.

There's a second error... the 'language' passed to the Messaging_Message object should be a string, not an object.
(If $message->language is set to an object, as per Messaging_Object::__construct()... then at some point, you'll get warning messages in Messaging_Object::set_language(). The isset() statement on line 124 will bork.)

jose reyero’s picture

Status: Needs review » Closed (fixed)

Fixed, thanks

roderik’s picture

Title: messaging_template_build missing return statement » messaging_template_build() fix
Version: 6.x-4.0-beta7 » 6.x-4.0-beta8
Status: Closed (fixed) » Needs review
StatusFileSize
new570 bytes

As per my patch/comments in #2, the 'language' item should contain a string, not an object.

Re-roll against beta8.