Download & Extend

warning: preg_match() expects parameter 2

Project:Invite
Version:6.x-2.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (duplicate)

Issue Summary

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 ','

Comments

#1

Status:active» needs review

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)

AttachmentSize
invite-628690.patch 1.08 KB

#2

testing

#3

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.

#4

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?

#5

Status:needs review» reviewed & tested by the community

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

#6

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. :)

#7

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)

#8

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

#9

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.

#10

Patch from #1 fixed the problem. thanks!.

#11

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?

#12

I am also getting this error using 6x2.xdev

#13

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.

#14

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

#15

Status:needs work» closed (duplicate)

Marking as duplicate of #324945: Warning returned after successfully sending invitations.

nobody click here