Mass email not possible

igorik - November 30, 2008 - 13:33
Project:Invite
Version:6.x-2.0-alpha1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:reviewed & tested by the community
Description

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

#1

fudge714 - December 12, 2008 - 11:37

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

#2

guldi - January 21, 2009 - 14:17

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

#3

Jaapx - February 5, 2009 - 10:38
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?

#4

Jaapx - February 5, 2009 - 14:34
Title:Solution» Mass email not possible

#5

igorik - February 5, 2009 - 23:41

It works, thanks!

#6

kaay - May 20, 2009 - 02:06

your code is working fine thanks for the help

#7

stattalk - May 28, 2009 - 21:26
Version:6.x-2.x-dev» 6.x-2.0-alpha1

This works like a charm.

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

#8

tayzlor - June 9, 2009 - 10:53

is there a patch for this bug?

#9

bob-hinrichs - June 11, 2009 - 22:17

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

#10

neilnz - June 18, 2009 - 05:34

Patch attached

AttachmentSize
invite.module.custommsg.patch 1.43 KB

#11

macrocosm - September 15, 2009 - 12:01

$ 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.

#12

macrocosm - September 15, 2009 - 12:12
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

 
 

Drupal is a registered trademark of Dries Buytaert.