warning: preg_match() expects parameter 2 to be string, array given in /var/www/html/drupal/includes/bootstrap.inc on line 777.

sending invite with two email addresses separated by ','

CommentFileSizeAuthor
#1 invite-628690.patch1.08 KBchristianchristensen

Comments

christianchristensen’s picture

Status: Active » Needs review
StatusFileSize
new1.08 KB

This is a problem where the message is set from the text box on the form, but the $message variable is overwritten by the drupa_mail function in the message to multiple emails loop.

Quickfix - save off the message into another variable before the loop then reset the $message variable on the start of the loop...
(see patch)

altparty’s picture

testing

mattyoung’s picture

with the path, I get these warnings:



    * warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'invite_access_callback' was given in /var/www/html/drupal/includes/menu.inc on line 452.
    * warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'invite_access_callback' was given in /var/www/html/drupal/includes/menu.inc on line 452.
    * warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'invite_access_callback' was given in /var/www/html/drupal/includes/menu.inc on line 452.
    * warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'invite_access_callback' was given in /var/www/html/drupal/includes/menu.inc on line 452.
    * warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'invite_access_callback' was given in /var/www/html/drupal/includes/menu.inc on line 452.

without the patch, I don't get these warnings.

christianchristensen’s picture

I have just tested this again with a clean install of drupal and the DRUPAL-6--2 of the invite module with token and devel enabled as well. I sent to several emails to [random emails]@example.com and checked the send log of which all had the message (none had 'Array' for the multiple). I also checked my PHP log and saw no warnings.
Could you describe how to replicate the warnings?

mattyoung’s picture

Status: Needs review » Reviewed & tested by the community

I tried again and don't get the error anymore.

Kristina-2’s picture

Hi.
I know it's been "reviewed and tested" but I wanted to make sure you had a report, with what I did that caused the error just in case.

I was sending an invitation to multiple users, and wrote in a personal message. I submitted the invite form and got:

warning: preg_match() expects parameter 2 to be string, array given in /home/kristina/qwodev/includes/bootstrap.inc on line 777.
warning: preg_match() expects parameter 2 to be string, array given in /home/kristina/qwodev/includes/bootstrap.inc on line 777.
warning: preg_match() expects parameter 2 to be string, array given in /home/kristina/qwodev/includes/bootstrap.inc on line 777.
warning: preg_match() expects parameter 2 to be string, array given in /home/kristina/qwodev/includes/bootstrap.inc on line 777.
warning: preg_match() expects parameter 2 to be string, array given in /home/kristina/qwodev/includes/bootstrap.inc on line 777.

url: http://qwodev.kristinahall.ca/user/25/invites/pending

Drupal 6.15
Invite 6.x-2.0-alpha1

I will install dev and see if I experience this when I invite another user later. :)

srobert72’s picture

Error still exists with Drupal 6.16
warning: preg_match() expects parameter 2 to be string, array given in /home/drupal/includes/bootstrap.inc on line 777.

It appears only on translated pages. It doesn't on pages in default language.

I use Invite 6.x-2.x-dev (2010-Jan-26)

Kristina-2’s picture

Got the error in drupal 6.16.

warning: preg_match() expects parameter 2 to be string, array given in /home/kristina/qwodev/includes/bootstrap.inc on line 777.
warning: preg_match() expects parameter 2 to be string, array given in /home/kristina/qwodev/includes/bootstrap.inc on line 777.
warning: preg_match() expects parameter 2 to be string, array given in /home/kristina/qwodev/includes/bootstrap.inc on line 777

cerup’s picture

Error still exists!

I tried sending two messages seperated by a comment and recieved the error.

If I only send one message the error does not occur; anything more than 1 and it has multiple errors.

The patch from #1 fixes this.

ifuyivara’s picture

Patch from #1 fixed the problem. thanks!.

preper’s picture

I have the same problem. I am using 6.x 2.x dev version. I didn't try the patch but when I send multiple invitations I got this error:

warning: preg_match() expects parameter 2 to be string, array given in /includes/bootstrap.inc on line 777 invitation

Can it be fixed in new dev version?

j0k3z’s picture

I am also getting this error using 6x2.xdev

srobert72’s picture

Status: Reviewed & tested by the community » Needs work

Patch#1 changes nothing for me.
Problem still exists, Invite 6.x-2.x-dev and Drupal 6.17

This issue appears in many posts. I'm not sure it is really due to Invite module.

srobert72’s picture

Hi all, here is a solution:

for Drupal 6.16
http://drupal.org/node/525036#comment-2144000
for Drupal 6.17
http://drupal.org/node/525036#comment-3046610

smk-ka’s picture

Status: Needs work » Closed (duplicate)