BuddyDev

Search

Error when creating a user with BP multi network

  • Participant
    Level: Initiated
    Posts: 6
    Pedro on #39801

    Hi guys,
    The user gets created well (only tried from the backend yet) but I receive these errors in the debug :

    [28-Jul-2021 21:24:43 UTC] PHP Notice: wpdb::prepare was called incorrectly. The query does not contain the correct number of placeholders (0) for the number of arguments passed (2). Please see Debugging in WordPress for more information. (This message was added in version 4.8.3.) in /var/www/wordpress/wp-includes/functions.php on line 5535
    [28-Jul-2021 21:24:43 UTC] WordPress database error Duplicate entry ‘3-1’ for key ‘wp_bp_mnetwork_users.user_id’ for query INSERT INTO wp_bp_mnetwork_users SET user_id=3, network_id = 1 made by wpmu_activate_signup, do_action(‘wpmu_activate_user’), WP_Hook->do_action, WP_Hook->apply_filters, BP_Multi_Network_Actions->on_user_activation, mnetwork_add_user, BP_Multi_Network_Users::add_user

    Any idea?
    Thanks for your help and this amazing plugin.

  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #39831

    Hi Pedro ,
    thank you for reporting. It may happen if a user belonging to the network gets added again. I am not sure of the reason why the user is being added for the second time.

    I will push a release next week to check for existing instead of relaying on index to discard the entry.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 6
    Pedro on #39836

    Thank you Singh for your reply.
    I have run more tests, here are the results :
    – register user in subsite frontend : No error
    – add user in network backend : No error
    – add user in subsite backend : Error
    I suppose in that case the network creates the user first, that’s why your plugin cannot create it again.

    • This reply was modified 3 years, 3 months ago by Pedro.
  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #39930

    Hi Pedro,
    Thank you for the reply.

    I have pushed a release. Please upgrade. it will not issue any notice now.

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: not resolved