Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter teeboy4real

    (@teeboy4real)

    this is the code i have in my bp-custom.php file

     function bp_reorder_buddypress_profile_tabs() {
    	$bp  = buddypress();
    	$nav = $bp->members->nav;
    
    	// it's a map of nav items for user profile to their position.
    	$nav_items = array(
    		'activity' => 10,
    		'my-blog' => 20,
    		'adverts'  => 30,
    		'profile'   => 40,
    		'following'    => 50,
    		'followers' => 60,
    		'messages'  => 70,
    		'notifications'  => 80,
    		'orders'  => 90,
    		'contact-me' => 100,
    		'settings'  => 110,
    	);
    
    	foreach ( $nav_items as $nav_item => $position ) {
    		$nav->edit_nav( array( 'position' => $position ), $nav_item );
    	}
    }
    add_action( 'bp_setup_nav', 'bp_reorder_buddypress_profile_tabs', 999 ); 
    Plugin Author Mathieu Viet

    (@imath)

    Hi @teeboy4real thanks for your feedback. I’ll test this asap. A lot of what’s inside your logs are not linked to BP Rewrites, some are just notices but there’s one issue I agree needs to be looked at.

    I’ll do so asap.

    • This reply was modified 2 years, 7 months ago by Mathieu Viet.
    Plugin Author Mathieu Viet

    (@imath)

    FYI, I’ve tested the bp-custom.php code you shared and I’m not getting any error. To reproduce the error, I need to use an earlier hook than bp_setup_nav. Using bp_setup_nav to hook your custom code is the right choice, I don’t get why you receive an error on your side. I suspect one of your plugin is creating some BuddyPress nav items before BP Rewrites had time to reorder the BP hooks sequence.

    To prevent the fatal error you found in this particular case, I’ll first make sure it does not happen anymore. See the PR I’ve been working on to achieve this goal: https://github.com/buddypress/bp-rewrites/pull/42

    I’d be interested to know which BuddyPress plugins you activated on your setup.

    Plugin Author Mathieu Viet

    (@imath)

    Just released 1.4.0 to fix this issue.

    Thread Starter teeboy4real

    (@teeboy4real)

    Hello sir,

    I’ve tested the new version and I’m not getting errors again.
    I’ll keep monitoring my logs if anything comes up again.

    Thanks for your hard work and support.

    Plugin does not integrate with other BP Plugins

    The plugin does not work with the following plugins and does not display “Groups” and “Members” on a BP-Site. Tested here: Groups

    Procedure: Install plugin from (official) “BuddyPress Add-ons”. Enable and leave it at the default options. Log in as a user and go to the Groups or Members menu.

    Result: Nothing is displayed!
    Message: “Loading the groups of the community. Please wait.”

    With one exception (BP Profile Search) always with front debug error messages. After deactivating the following plugins, the display works correctly!

    • BP Profile Search 5.4.7 (no Fronted Debug Errors)
    • BuddyDrive 2.1.1 (Debug Errors Frontend)
    • BuddyPress Docs 2.1.8 (Debug Errors Frontend)
    • Rendez Vous 1.4.2 (Debug Errors Frontend)
    • MediaPress 1.5.3 (Debug Errors Frontend)
    All Errros are similar like:
    
    # BuddyDrive 2.1.1 (Debug Error Frontend)
    require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), WP_Hook->do_action, WP_Hook->apply_filters, bp_init, do_action('bp_init'), WP_Hook->do_action, WP_Hook->apply_filters, BuddyDrive_Screens::manage_screens, BuddyDrive_Screens->__construct, BuddyDrive_Screens->setup_filters, bp_is_current_component, apply_filters('bp_is_current_component'), WP_Hook->apply_filters, BP\Rewrites\bp_is_current_component, BP\Rewrites\bp_current_component, BP\Rewrites\_was_called_too_early.
    
    require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), WP_Hook->do_action, WP_Hook->apply_filters, bp_init, do_action('bp_init'), WP_Hook->do_action, WP_Hook->apply_filters, BuddyDrive_Screens::manage_screens, BuddyDrive_Screens->__construct, BuddyDrive_Screens->setup_filters, buddydrive_is_group, bp_is_groups_component, bp_is_current_component, apply_filters('bp_is_current_component'), WP_Hook->apply_filters, BP\Rewrites\bp_is_current_component, BP\Rewrites\bp_current_component, BP\Rewrites\_was_called_too_early.
    
    require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), WP_Hook->do_action, WP_Hook->apply_filters, bp_init, do_action('bp_init'), WP_Hook->do_action, WP_Hook->apply_filters, bp_init_group_extensions, BuddyDrive_Group->__construct, BuddyDrive_Group->enable_nav_item, bp_get_current_group_id.
    
    SERVER LOG:
    
    Stack trace:
    #0 /var/www/html/DOMAIN/wp-includes/link-template.php(393): _get_page_link()
    #1 /var/www/html/DOMAIN/wp-content/plugins/bp-profile-search/bps-directory.php(45): get_page_link()
    #2 /var/www/html/DOMAIN/wp-content/plugins/bp-profile-search/bps-directory.php(22): bps_directories()
    #3 /var/www/html/DOMAIN/wp-content/plugins/bp-profile-search/bps-directory.php(320): bps_is_directory()
    #4 /var/www/html/DOMAIN/wp-includes/class-wp-hook.php(310): bps_custom_directory()
    #5 /var/www/html/DOMAIN/wp-includes/plugin.php(205): WP_Hook->apply_filters()
    #6 /var/www/html/DOMAIN/wp-content/plugins/buddypress/src/bp-core/bp-core-functions.php(624): apply_filters()
    #7 /var/www/html/DOMAIN/wp-content/plugins/buddypress/src/bp-core/bp-core-functions.php(718): bp_core_get_directory_page_ids()
    #8 /var/www/html/DOMAIN/wp-content/plugins/bp-rewrites/src/bp-core/bp-core-catchuri.php(110): bp_core_get_directory_pages()
    #9 /v in /var/www/html/DOMAIN/wp-includes/link-template.php on line 431
    [03-Feb-2023 15:48:00 UTC] PHP Fatal error:  Uncaught Error: Call to a member function get_page_permastruct() on null in /var/www/html/DOMAIN/wp-includes/link-template.php:431

    WP 6.1.1
    BP 11.0
    Theme: BuddyX 4.4.6
    bp-custom.php (disabled while testing)
    PHP 7.4.33
    MariaDB (MySQL 5.5.5)

    Plugin Author Mathieu Viet

    (@imath)

    Hi @user4forum,

    Thanks a lot for your tests & for your report. Let’s put things in the right order ??.

    Plugin does not integrate with other BP Plugins

    The goal of the BP Rewrites plugin is to inform which plugins will have to change the way they are extending BuddyPress. So the fact you’re getting these notices (most are not errors) is a very good thing. It means you know that when BuddyPress 12.0 will be released, as it should merge the BP Rewrites plugin, all the authors of the plugins you listed need to work to be compatible with the next BuddyPress major release.

    As unfortunately BP Rewrites has not been tested enough by plugin authors, we will build a specific plugin to keep you use them. No worries.

    That being said, I’ll check all notices, it’s a very important contribution, you just did, thanks again??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Getting more errors’ is closed to new replies.