Hi

I found when I enable mass inviting for authenticated users, all messages except the first one have word 'array' instead user message in email body.
The first message has correcty user message inside it.
Using latest dev version.

thanks
Igorik
http://www.somvprahe.sk

CommentFileSizeAuthor
#10 invite.module.custommsg.patch1.43 KBneilnz

Comments

fudge714’s picture

Hi,

I'm having the same problem.

The first email its sent to is fine, and also its fine if only inviting one person. However if more, the second onwards all receive 'Array' instead of the message the inviting user fills in.

I also get the error:
warning: preg_match() expects parameter 2 to be string, array given in /var/www/vhosts/thesharehood.org/httpdocs/includes/bootstrap.inc on line 732.

and that comes from drupal_validate_utf8($text) in bootstrap.inc, which is mainly called by check_plain() I believe.

check_plain() is called about 5 times in invite.module, but I can't find any where what is being passed is an array rather than a string.

Anybody got any other ideas?

thanks,
Rachel

guldi’s picture

I also have the error with the "array" in mass emails (except the first mail of a mass email)

6.x-2.x-dev (inkl. patch invite.module.322748.diff) -> http://drupal.org/node/322748#comment-1208647

Anonymous’s picture

Title: mass invitating: messages except the first have word 'array' instead user message » Solution
Status: Active » Needs review

I had the same problem with an invite patched twice according to:
- http://drupal.org/node/330233
- http://drupal.org/node/322748#comment-1208647

The cause of the problem is dual use of the variable $message in the foreach loop of "Forms API callback; process submitted form data" in the invite.module.

Solution:

Change the following code (in my double patched version found in line 1081 and 1082, in unpatched modules mayby found on a place that is a little bi different):

$message = drupal_mail('invite', 'invite', $email, $language, $params, $from, TRUE);
if (1 || $message['result']) {

in:

$messagedrupal_mail = drupal_mail('invite', 'invite', $email, $language, $params, $from, TRUE);
if (1 || $messagedrupal_mail['result']) {

Maybe time for a new release?

Anonymous’s picture

Title: Solution » Mass email not possible
igorik’s picture

It works, thanks!

kaay’s picture

your code is working fine thanks for the help

stattler’s picture

Version: 6.x-2.x-dev » 6.x-2.0-alpha1

This works like a charm.

______________________
Let's talk statistics...
www.stattalk.org

tayzlor’s picture

is there a patch for this bug?

bob.hinrichs’s picture

Thanks much Jaapx, this solution works! Hope it makes it into the next release.

neilnz’s picture

StatusFileSize
new1.43 KB

Patch attached

Macronomicus’s picture

$ patch < invite.module.custommsg.patch
patching file invite.module
patch: **** malformed patch at line 11: invite_get_subject();

? ... guess I can do this by hand then ...
I ran the patch on both aplha1 & the dev with the same error.

Macronomicus’s picture

Status: Needs review » Reviewed & tested by the community

I can confirm this does fix the broken mass email functionality.

Not sure why the patch was failing .. this is about as simple as a patch can get .. just two words being replaced! lol

smk-ka’s picture

Status: Reviewed & tested by the community » Closed (duplicate)