Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Debug Error "bp_setup_current_user was called incorrectly"

  • Avatar of lucop1
    lucop1
    Participant

    @lucop1

    Hi,

    after upgrading from 1.6.5 to 1.7 I get this error constantly on each page and widget
    also in the wp-admin area..

    `Notice: bp_setup_current_user was called incorrectly. The current user is being initialized without using $wp->init(). Please see Debugging in WordPress for more information. (This message was added in version 1.7.) in /var/www/vhosts/xxxxxx.it/xxxxxx.it/wp-includes/functions.php on line 2960`

    how can i fix it?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Avatar of Renato Alves
    Renato Alves
    Participant

    @espellcaste

    Same here! :(

    Avatar of shanebpdev
    shanebp
    Participant

    @shanebp

    It is confusing.

    Something, probably a plugin, is most likely do a $current_user check
    for example: `is_user_logged_in()`
    in a file loaded via a loader.php with something like:
    `add_action( ‘bp_loaded’, ‘some_function_that_loads_a_file’ );`

    The codex recommends using bp_loaded, but in 1.7 the notice was added.
    I’ve been using this instead:
    `add_action( ‘bp_init’, ‘some_function_that_loads_a_file’, 9 );`

    The notice only appears if you have, in wp-config.php, debug set to true.
    `define(‘WP_DEBUG’, true);`

    Other than the notice, are you seeing anything that isn’t working probably?
    You could ignore it, at your peril, and set debug to false.
    Or you could deactivate your plugins one by one to see which one(s) is generating the notice.

    It would be helpful to get a definitive explanation from one of the core devs.

    Avatar of shanebpdev
    shanebp
    Participant

    @shanebp

    Courtesy of boone:

    Use `var_dump(debug_backtrace());` to see how things were loaded.
    Then comb thru the dump to see which plugin is generating the notice.

    Avatar of lucop1
    lucop1
    Participant

    @lucop1

    It was a bbPress error. Now fixed with the 2.4 version!

    So the topic status is SOLVED!

    Thank you Shane!!

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

You must be logged in to reply to this topic.