• Resolved jnlr

    (@jonathanlo)


    Hi there,

    On our website with buddyboss theme and Buddyboss Platform, users are registered either after purchase either after optin a Gravity Form.

    In this second option, when form is submitted I get the wp_die() screen, and this Fatal error in debug.log :

    [08-Jul-2025 16:57:55 UTC] PHP Fatal error: Uncaught Error: Cannot use object of type WP_User as array in /home/xxx/web/wp-content/plugins/bp-xprofile-location/inc/pp-field-type-location.php:165
    Stack trace: 0 /home/xxx/web/wp-includes/class-wp-hook.php(324): PP_Field_Location->pp_loc_activated_user()

    No idea why, the third param of hook bp_core_activated_user is well documented to get an Array of user data, but at this point this is an WP_User object.

    Thanks for help.

Viewing 1 replies (of 1 total)
  • Plugin Author shanebp

    (@shanebp)

    Thanks for the report. No other users have reported this issue.

    It may be that Gravity Forms ( or something else ) is converting $user from an array to an object. Have you tried registration without the purchase / form step(s)? If the error does not occur, then you know something is being changed in the register step when you use the purchase / form.

    You could just change the $user ( in function pp_loc_activated_user ) to be read as an object – it is only 3 small changes.

Viewing 1 replies (of 1 total)

The topic ‘PHP Fatal error: Cannot use object of type WP_User as array’ is closed to new replies.