• Resolved shawfactor

    (@shawfactor)


    I have activated bp rewrites and tested with only buddypress active and I am getting the following fatal error

    PHP Fatal error: Uncaught Error: Cannot use object of type stdClass as array in /home/melbour9/public_html/wp-content/plugins/bp-rewrites/src/bp-members/bp-members-invitations.php:39

    Stack trace:
    #0 /home/melbour9/public_html/wp-includes/class-wp-hook.php(307): BP\Rewrites\bp_members_invitations_setup_nav('')
    #1 /home/melbour9/public_html/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array)
    #2 /home/melbour9/public_html/wp-includes/plugin.php(474): WP_Hook->do_action(Array)
    #3 /home/melbour9/public_html/wp-content/plugins/buddypress/bp-core/bp-core-dependency.php(155): do_action('bp_setup_nav')
    #4 /home/melbour9/public_html/wp-includes/class-wp-hook.php(307): bp_setup_nav('')
    #5 /home/melbour9/public_html/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array)
    #6 /home/melbour9/public_html/wp-includes/plugin.php(474): WP_Hook->do_action(Array)
    #7 /home/melbour9/public_html/wp-content/plugins/buddypress/bp-core/bp-core-dependency.php(267): do_action('bp_init')
    #8 /home/melbour9/public_html/wp-includes/class-wp-hook.php(307): bp_init('')
    #9 /home/melbour9/public_html/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array)
    #10 /home/melbour9/public_html/wp-includes/plugin.php(474): WP_Hook->do_action(Array)
    #11 /home/melbour9/public_html/wp-settings.php(587): do_action('init')
    #12 /home/melbour9/public_html/wp-config.php(112): require_once('/home/melbour9/...')
    #13 /home/melbour9/public_html/wp-load.php(50): require_once('/home/melbour9/...')
    #14 /home/melbour9/public_html/xmlrpc.php(31): require_once('/home/melbour9/...')
    #15 {main}

    $main_nav = $bp->members->nav->get_primary( array( ‘slug’ => $parent_slug ), false );

    $main_nav ius rturning the following onject but your code expects an array

    stdClass Object
    (
        [component_id] => invitations
        [name] => Invitations
        [slug] => invitations
        [link] => invitations/
        [css_id] => invitations
        [show_for_displayed_user] => 
        [position] => 80
        [screen_function] => members_screen_send_invites
        [default_subnav_slug] => list-invites
    )
    • This topic was modified 2 years, 7 months ago by shawfactor.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Mathieu Viet

    (@imath)

    Hi!

    Thanks a lot for contributing to BP Rewrites. You’re right there’s an issue with the Members Invitations feature. I’ve just created a PR to fix it, see:
    https://github.com/buddypress/bp-rewrites/pull/37

    It will be fixed in next minor version of the plugin: 1.1.0.

    In the meantime, if you want to test other areas of BP Rewrites, you can deactivate the plugin, Go to WP Admin > Settings > BuddyPress > Options. Once there, disable the “Allow registered members to invite people to join this network” option. Then, you can safely activate BP Rewrites back.

    Plugin Author Mathieu Viet

    (@imath)

    You can update to 1.1.0, this maintenance release include the fix for this issue.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Getting a fatal error’ is closed to new replies.