Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Groups function is broken


  • pihla
    Participant

    @pihla

    It seems that after updating to WP 4.2.2 my groups function is not working anymore. Always when I try to create group, I get the following message (I have put WP_DEBUG as true in config file):

    WordPress database error: [Duplicate entry '0' for key 'PRIMARY']
    INSERT INTO wp_bp_groups_members ( user_id, group_id, inviter_id, 
    is_admin, is_mod, is_banned, user_title, date_modified, 
    is_confirmed, comments, invite_sent ) 
    VALUES ( 22, 0, 0, 1, 0, 0, 'Ryhmän ylläpitäjä', 
    '2015-06-15 09:33:16', 1, '', 0 )

    Even I get this error, it creates a group in to the database with id 0. And if I delete all rows in the wp_groups and wp_group_meta and try to create a new group, it will give the same error. This has not been happening before and the site has been active for many months now.

    I can not create group in the admin side either. All the plugins are up to date, I even tried to disable all other plugins, but the problem continues.

    I am using WP 4.2.2 and BP 2.3.1 and the site name is homesome.com

    Thanks for help in advance!

Viewing 15 replies - 1 through 15 (of 15 total)

  • pihla
    Participant

    @pihla

    Hi,

    I get the following error:
    Strict Standards: Declaration of BBP_Forums_Group_Extension::display() should be compatible with BP_Group_Extension::display($group_id = NULL) in /home/c5dh5rak/public_html/wp-content/plugins/bbpress/includes/extend/buddypress/groups.php on line 28

    I’m using BuddyPress 2.3.1 and WP 4.2.2 Finnish.

    The site is Homesome.com

    Thanks for support =)

    -Pihla


    danbp
    Participant

    @danbp

    That’s an old bug who was patched. (see here) Check bbpress code and update it if you’re using an older version.

    Also, if you have debug mode on in wp-config, revert it to off.
    If the message still remains, deactivate your theme and use Twenty Fifteen or Fourteen to test.
    If the message disappear, you know the culprit. In that case , contact your theme support


    pihla
    Participant

    @pihla

    Ok the pacth fixed that issue, but now I get information that there is a duplicate entry in the database and it continues even if I delete all rows from wp_bp_groups and wp_bp_groups_groupmeta

    It seems that the group created is always created with id 0. This has not happened before. Why can this be? My wp shows that all of the plugins are up to date.

    @pihla I can’t replicate this issue on a trunk install or stable 2.3.1 tag on single site twentyfifteen/fourteen.

    I can create groups with out issue and they receive the group creator as primary admin / member

    Are there any other possible factors overlooked that could be affecting things?


    shanebp
    Moderator

    @shanebp

    it creates a group in to the database with id 0

    That’s the first thing to solve. The id should be auto-incremented.

    There have been some non-BP reports re WP 4.2.2 $wpdb->insert_id returning 0.

    How many characters are in your group title?

    Hi Pihla-

    I can’t reproduce the problem you’re having. Can you add a tracer to your theme’s functions file or to bp-custom.php then try to create a group?

    https://gist.github.com/dcavins/a9197f21d7f31b6594bc

    I added this to my theme’s functions.php and the file that it created (groups_group_after_save_args.txt) ended up at the root of my site. It looked like this:

    
    newly created group args: BP_Groups_Group Object
    (
        [id] => 8
        [creator_id] => 4
        [name] => Number 5
        [slug] => number-5
        [description] => Will this be recorded?
        [status] => public
        [enable_forum] => 0
        [date_created] => 2015-06-15 14:59:00
        [admins] => 
        [mods] => 
        [total_member_count] => 
        [is_member] => 
        [is_invited] => 
        [is_pending] => 
        [last_activity] => 
        [user_has_access] => 
        [args] => Array
            (
                [populate_extras] => 
            )
    
    )
    

    Please let me know if you can do this test and what the results are.


    pihla
    Participant

    @pihla

    Hello,

    I had to delete the group that had been created with id 0 before I got this tracer to work. But then it showed this:

    newly created group args: BP_Groups_Group Object
    (
    [id] => 0
    [creator_id] => 22
    [name] => test group
    [slug] => test-group
    [description] => this is a test group
    [status] => public
    [enable_forum] => 0
    [date_created] => 2015-06-16 07:54:06
    [admins] =>
    [mods] =>
    [total_member_count] =>
    [is_member] =>
    [is_invited] =>
    [is_pending] =>
    [last_activity] =>
    [user_has_access] =>
    [args] => Array
    (
    [populate_extras] =>
    )

    )

    So the problem is that the group is always created with id=0. I was able to create a page though, so I don’t think it is the same problem that @shanebp mentioned as a problem of 4.2.2 but who knows.


    pihla
    Participant

    @pihla

    @shanebp

    I have tried with several group names, does it have a difference?


    pihla
    Participant

    @pihla

    I emptied these three:
    wp_groups
    wp_groups_groupmeta
    wp_groups_members

    I managed to create one group (which does not show in the public side) but the next group I created gave this error:
    WordPress database error: [Duplicate entry ‘0’ for key ‘PRIMARY’]
    INSERT INTO wp_bp_groups ( creator_id, name, slug, description, status, enable_forum, date_created ) VALUES ( 22, ‘Vanhat talot’, ‘vanhat-talot’, ‘Vanhat talot’, ‘public’, 0, ‘2015-06-16 08:25:16’ )

    I can not understand, this seems to say that enable_forum would be primary key which it can not be…


    shanebp
    Moderator

    @shanebp

    Re group name length: I was just guessing, since I cannot duplicate the error.
    ‘Vanhat talot’ is short, so that shouldn’t be the issue.

    So you created a group – and the id was 0, correct ?
    Then the next group failed due to the duplicate entry 0, correct ?
    If so, then the group id field is not being auto-incremented.

    The enable_forum field should be 0 if you did not select ‘I want a forum’ when you created the group.
    If you did select ‘I want a forum’, which version of bbPress are you using?


    pihla
    Participant

    @pihla

    Yes, this is exactly the case, it does not create the second group, because the id is 0 so the auto-increment is not working (and the first one created a row in the database, but does not show in the front end)

    Yes, there is nothing wrong with the id 0 with the forum, I was just wondering why does it give duplicate entry warning with this:
    WordPress database error: [Duplicate entry ‘0’ for key ‘PRIMARY’]
    INSERT INTO wp_bp_groups ( creator_id, name, slug, description, status, enable_forum, date_created ) VALUES ( 22, ‘Vanhat talot’, ‘vanhat-talot’, ‘Vanhat talot’, ‘public’, 0, ‘2015-06-16 08:25:16′ )

    and the only 0 in this insert is the enable_forum which should not be primary, but well this might just refer to the group_id field that is not auto incremented.

    I even updated the themes Buddy Press and bbPress files (Kleo-theme) and updated again Buddy Press, even though it was in version 2.3.1, did not help…


    @shanebp
    where did you find the information about the non-BP reports where WP 4.2.2 $wpdb->insert_id returns 0? I could try to find the info from there.

    Hi @pilha-

    That’s totally weird behavior. It seems like the table in your database has lost its mind. 🙂

    Can you check the structure of the table wp_bp_groups? What I want to know is:

    • Is id set as the primary key?
    • Is id set to auto-increment?

    Since you’ve already emptied records from the database, I suspect you’re familiar with some software for MySQL management like phpMyAdmin. Can you check the questions above?


    pihla
    Participant

    @pihla

    Hi,

    Yes, id is set to primary, not auto-increment. Can I change this somehow?


    shanebp
    Moderator

    @shanebp

    If you’re using phpMyAdmin –
    Go to the table, select ‘Structure’, select ‘Change’ for the row ‘id’.
    Look thru the options for ‘Auto Increment’ – it may be a checkbox labeled A_I.


    pihla
    Participant

    @pihla

    JIIIHAAAAA!!!! That did it, thank you soooo much! <3

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘[Resolved] Groups function is broken’ is closed to new replies.
Skip to toolbar