Buddypress ajax problem after adding new groups sub nav [closed]

Is i commented previously im having the same error. I dont know what it causing it but i found a workaround for it.

Im using a modified version (by me) of the plugin buddypress-groups-tags which allows me to create categories for groups. That plugin uses bp_core_new_subnav_item to be able to use slugs like : http://local.dev/groups/category/teachers/

My problem was that inside that url in the activity loop, the more link was getting a 404 responde header error on admin-ajax.php. If i check the response content all the activity data was there. So im not sure what is causing the problem.

To solve it i added a function that will return a status header of 200 when the ajax call is triggered. In my case i needed for “get_older_updates” action but i suppose you can use it for any other action defined at /bp-themes/bp-default/_inc/ajax.php:27

add_action( 'wp_ajax_activity_get_older_updates', 'bp_dtheme_activity_template_loader2' );
add_action( 'wp_ajax_nopriv_activity_get_older_updates', 'bp_dtheme_activity_template_loader2' );

function bp_dtheme_activity_template_loader2(){
    if(isset($_REQUEST['action']) && $_REQUEST['action'] == 'activity_get_older_updates')
    {
        status_header( 200 );
    }
}   

Hope it helps!