When I send an invite and the invited email already belongs to a user on my site, the invite module catches it. This is good! However, it puts up a really scary looking warning message that reads like this:

    * The following recipient is already a member:
      Bling Bling (bling@pmail.com)
    * warning: array_fill() [function.array-fill]: Number of elements must be positive in /home/mrsriley/mrsriley/includes/database.inc on line 240.
    * warning: implode() [function.implode]: Bad arguments. in /home/mrsriley/mrsriley/includes/database.inc on line 240.
    * user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND uid = 6054 AND canceled = 0' at line 1 query: SELECT email FROM invite WHERE email IN () AND uid = 6054 AND canceled = 0 in /home/mrsriley/mrsriley/sites/all/modules/invite/invite.module on line 997.

Has anyone encountered this? Do I have the verbosity of warnings set too high or is this legitimately not handling this case properly?

Thanks!

CommentFileSizeAuthor
#8 invite_form_validate.patch1.08 KBbarrett

Comments

kenorb’s picture

Category: support » bug

I can confirm this bug.

The following recipient is already a member:
...
# warning: array_fill() [function.array-fill]: Number of elements must be positive in /home/sites/co.uk/public_html/includes/database.inc on line 241.
# warning: implode() [function.implode]: Invalid arguments passed in /home/sites/co.uk/public_html/includes/database.inc on line 241.
# user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND uid = 4 AND canceled = 0' at line 1 query: SELECT email FROM invite WHERE email IN () AND uid = 4 AND canceled = 0 in /home/sites/co.uk/public_html/sites/all/modules/contributions/invite/invite.module on line 997.
that0n3guy’s picture

I can also confirm this bug :)



    * The following recipient is already a member:
      theadmin (some_email@gmail.com)
    * warning: array_fill() [function.array-fill]: Number of elements must be positive in /home/effortle/public_html/peterjolson.com/includes/database.inc on line 241.
    * warning: implode() [function.implode]: Invalid arguments passed in /home/effortle/public_html/peterjolson.com/includes/database.inc on line 241.
    * user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND uid = 1 AND canceled = 0' at line 1 query: SELECT email FROM invite WHERE email IN () AND uid = 1 AND canceled = 0 in /home/effortle/public_html/peterjolson.com/sites/all/modules/invite/invite.module on line 997.

geraldito’s picture

same error message here

ckidow’s picture

Same thing here!

bensemmel’s picture

Same for me

saturnin’s picture

I confirm

zmove’s picture

confirmed too.

Is the module still maintained ? the issue queue seems empty of solutions and no new release were posted since a long time.

barrett’s picture

StatusFileSize
new1.08 KB

I think I've gotten this fixed. The issue seems to be that the check to see if users had already been invited occurred whether or not all the emails had been pulled out as already belonging to members.

The attached patch works on my system. Let me know what you think.

Barrett

neokrish’s picture

Yes, this patch works. Can this be commited?

skizzo’s picture

Status: Active » Needs review

I am getting the error reported in OP using today's build 6.x-1.x-dev (packaging script on 2009-04-17).
Proposed patch works for me too. Changing status to "needs review" (hoping that I do understand the protocol)

avpaderno’s picture

Status: Needs review » Reviewed & tested by the community
sun’s picture

Status: Reviewed & tested by the community » Fixed

Whoever considered this patch as RTBC has no idea of Drupal's coding standards.

I've fixed up the necessary/remaining things and committed this fix to all 2.x branches.

Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.