Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] groups_invite_user do nothing


  • elpix
    Participant

    @elpix

    Hi Everyone,

    I’m trying to create a plugin which send automaticaly invitations to join group.
    Here is my code :

    
    $group = new BP_Groups_Group( $group_id );
    groups_invite_user( array( 'user_id' => $user_id, 'group_id' => $group_id, 'inviter_id' => $group->creator_id, 'is_confirmed' => 0 ) );
    groups_send_invites( $group->creator_id, $group_id );
    

    I have thoses errors :

    Notice: Undefined property: BP_Groups_Component::$table_name in /var/www/wp-content/plugins/buddypress/bp-groups/bp-groups-classes.php on line 61
    
    WordPress database error: [Table 'biowebspin_v6.g' doesn't exist]
    SELECT g.* FROM g WHERE g.id = 18728
    
    Notice: Undefined property: BP_Groups_Component::$table_name_members in /var/www/wp-content/plugins/buddypress/bp-groups/bp-groups-classes.php on line 1538
    WordPress database error: [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 'WHERE user_id = 21 AND group_id = 18728 AND is_confirmed = 1 AND is_banned = 0' at line 1]
    SELECT id FROM WHERE user_id = 21 AND group_id = 18728 AND is_confirmed = 1 AND is_banned = 0
    
    Notice: Undefined property: BP_Groups_Component::$table_name_members in /var/www/wp-content/plugins/buddypress/bp-groups/bp-groups-classes.php on line 1488
    WordPress database error: [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 'WHERE user_id = 21 AND group_id = 18728 AND is_confirmed = 0 AND inviter_id != 0' at line 1]
    SELECT id FROM WHERE user_id = 21 AND group_id = 18728 AND is_confirmed = 0 AND inviter_id != 0
    
    Notice: Undefined property: BP_Groups_Component::$table_name_members in /var/www/wp-content/plugins/buddypress/bp-groups/bp-groups-classes.php on line 1231
    WordPress database error: [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 'WHERE user_id = 21 AND group_id = 18728 AND is_confirmed = 1 LIMIT 1' at line 1]
    SELECT id FROM WHERE user_id = 21 AND group_id = 18728 AND is_confirmed = 1 LIMIT 1
    
    Notice: Undefined property: BP_Groups_Component::$table_name_members in /var/www/wp-content/plugins/buddypress/bp-groups/bp-groups-classes.php on line 1235
    WordPress database error: [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 '( user_id, group_id, inviter_id, is_admin, is_mod, is_banned, user_title, date_m' at line 1]
    INSERT INTO ( user_id, group_id, inviter_id, is_admin, is_mod, is_banned, user_title, date_modified, is_confirmed, comments, invite_sent ) VALUES ( 21, 18728, 0, 0, 0, 0, '', '2013-10-31 18:20:33', 0, '', 0 )
    
    Notice: Undefined property: BP_Groups_Component::$table_name_members in /var/www/wp-content/plugins/buddypress/bp-groups/bp-groups-classes.php on line 217
    WordPress database error: [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 'WHERE group_id = 18728 and is_confirmed = 0 AND inviter_id = 0' at line 1]
    SELECT user_id FROM WHERE group_id = 18728 and is_confirmed = 0 AND inviter_id = 0
    
    Notice: Undefined property: BP_Groups_Component::$table_name in /var/www/wp-content/plugins/buddypress/bp-groups/bp-groups-classes.php on line 61
    WordPress database error: [Table 'biowebspin_v6.g' doesn't exist]
    SELECT g.* FROM g WHERE g.id = 18728
Viewing 1 replies (of 1 total)

  • elpix
    Participant

    @elpix

    Solution found !

    I was calling my script too early.
    Now I call it in the footer and no pb 🙂

Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] groups_invite_user do nothing’ is closed to new replies.
Skip to toolbar