Skip to:
Content

BuddyPress.org

Opened 11 years ago

Closed 11 years ago

#5305 closed defect (bug) (fixed)

Indirect modification of overloaded property BuddyPress::$signup

Reported by: reactuate's profile reactuate Owned by: boonebgorges's profile 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.

Attachments (1)

5305.patch (1007 bytes) - added by boonebgorges 11 years ago.

Download all attachments as: .zip

Change History (4)

#1 @boonebgorges
11 years ago

  • Keywords has-patch needs-testing added
  • Milestone changed from Awaiting Review to 2.0
  • Priority changed from normal to low
  • Severity changed from normal to minor

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?

@boonebgorges
11 years ago

#2 @DJPaul
11 years ago

  • Keywords commit added

#3 @boonebgorges
11 years ago

  • Owner set to boonebgorges
  • Resolution set to fixed
  • Status changed from new to closed

In 7738:

Define $bp->signup in the members component loader

Setting up the dummy class here ensures that we don't get PHP notices
downstream.

Fixes #5305

Props reactuate for initial patch

Note: See TracTickets for help on using tickets.