Closed (duplicate)
Project:
Invite
Version:
6.x-2.0-alpha1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
30 Nov 2008 at 13:33 UTC
Updated:
1 Aug 2010 at 16:21 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
fudge714 commentedHi,
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
Comment #2
guldi commentedI 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
Comment #3
Anonymous (not verified) commentedI 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?
Comment #4
Anonymous (not verified) commentedComment #5
igorik commentedIt works, thanks!
Comment #6
kaay commentedyour code is working fine thanks for the help
Comment #7
stattler commentedThis works like a charm.
______________________
Let's talk statistics...
www.stattalk.org
Comment #8
tayzlor commentedis there a patch for this bug?
Comment #9
bob.hinrichs commentedThanks much Jaapx, this solution works! Hope it makes it into the next release.
Comment #10
neilnz commentedPatch attached
Comment #11
Macronomicus commented? ... guess I can do this by hand then ...
I ran the patch on both aplha1 & the dev with the same error.
Comment #12
Macronomicus commentedI 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
Comment #13
smk-ka commentedMarking as duplicate of #324945: Warning returned after successfully sending invitations.