Opened 11 years ago
Closed 11 years ago
#5305 closed defect (bug) (fixed)
Indirect modification of overloaded property BuddyPress::$signup
Reported by: | reactuate | Owned by: | boonebgorges |
---|---|---|---|
Milestone: | 2.0 | Priority: | low |
Severity: | minor | Version: | 1.9 |
Component: | Members | Keywords: | has-patch needs-testing commit |
Cc: |
Description
I have a plugin that calls bp_core_signup_user in bp-members-function.php from a 'bp_screens' action.
I get the error "<b>Notice</b>: Indirect modification of overloaded property BuddyPress::$signup has no effect in <b>/vagrant/wordpress/wp-content/plugins/buddypress/bp-members/bp-members-functions.php</b> on line <b>1308</b><br />"
This is because $bp->signup hasn't been created yet.
The fix is to add these lines at line 1308 before the line '$bp->signup->username = $user_login;' to insure the object exists:
if ( !isset( $bp->signup ) || !is_object( $bp->signup ) ) { $bp->signup = new stdClass; }
This is similar to other places in the code where the object isn't created yet.
Instead of defining this variable haphazardly throughout BP, let's set it in the bp-members loader class. Would you mind testing this patch to make sure it does the trick for you?