Ready to get started?Download WordPress


BadgeOS Community Add-on
For anyone with issues with the "Achievements" tab on user profiles. (2 posts)

  1. Michael Beckwith
    Plugin Author

    Posted 7 months ago #

    This is not in response to anyone specific, just a response to the issue at hand.

    The BadgeOS Community Addon checks for a few things before it generates the necessary information to create the "Achievements" tab. First it checks that there are any achievements awarded to the currently displayed user. If there are, it will start to loop through them all. In that loop, it constructs some variables to use, and it checks that we actually have an achievement to display. Lastly, it checks if the current achievement is set to be public for BuddyPress profiles. If all of these are met, it creates the parent tab for the main menu, and achievement type submenu tabs for each type that the user has earned. When you click a type, all of the achievements of that type get ajax loaded and displayed.

    To confirm that a tab should be display when it isn't, check the following two things.

    1. Has the user earned any achievements yet.
    To check, visit their user profile via the Users admin and click edit on their user. The achievements will be towards the bottom
    2. Of those earned achievements, are the types they're related to supposed to be displayed on the BuddyPress profiles.
    To check, visit the BadgeOS > Achievements Types area. Click to edit them, and check the two checkboxes that appear under the main settings. If they are not checked, enable that and hit save.
    **If you want to go the extra mile, check the database and wp_postmeta table for a set meta_value for the meta key of _badgeos_show_bp_member_menu

    If you have confirmed that the user has BuddyPress-displayed achievements, and are still not seeing an "Achievements" tab properly, let me know. If the website is publicly accessible, even if not "live", that will be a big help for us, though a localhost install still won't be impossible.

    IF you are not having issues with the tab itself, but more the area where the achievements should be showing, then let me know, and I'll do what I can to help debug that part. That's much more likely a javascript/ajax issue that trickles up to the core plugin itself, not just Community Addon.


  2. sj-xweb
    Posted 5 months ago #

    Hey, not sure if you guys are still looking for info on this issue, but we recently experienced the problem of achievement tab not displaying on member profile.

    After debugging the code a bit, I figured out that our problem was related to a mismatch of data.

    Specifically, it was on line 170 of badgeos-community-add-on/includes/bp-members.php:
    $post_id = isset( $arr_achievement_types[$achievement_type] ) ? $arr_achievement_types[$achievement_type] : 0;

    The short story is that $arr_achivement_types is populated with post_name as the array key, and $achievement_type is populated with post_type. Which worked, until someone updates the title of an Achievement Type (which was the case for us).

    Apparently post_name doesn't update when the title is changed, but any new achievements created using the new title will have the updated name as post_type. So from that point on, the code is trying use the new name to select from an array populated with old names

    After I updated the post_name field, the problem went away, and the achievement tab showed up again.

    I'm not sure if this is exactly the issue you're trying to resolve, and I hope it makes sense. Hopefully it will helps you with debugging the problem.


You must log in to post.

About this Plugin

About this Topic


No tags yet.