Skip to:
Content

Opened 21 months ago

Closed 21 months ago

Last modified 6 months ago

#4362 closed defect (bug) (fixed)

Registration Page Has Pre-Populated Fields

Reported by: shanebp Owned by: DJPaul
Milestone: 1.6 Priority: normal
Severity: normal Version:
Component: XProfile Keywords: commit
Cc:

Description

Some registration fields are pre-populated with data from user_id = 0.

r-a-y workaround in register.php:

if ( bp_has_profile( 'user_id=-1&profile_group_id=1' ) ) :

djpaul - "Two problems here. One, this zero matching. The second is how zero user ID profle data gets put into the database."

Per: http://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/registration-page-has-prepoulated-full-name-field-help/

And per:
http://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/how-to-clear-the-previous-registration-form-data-1/

Attachments (1)

4362.01.patch (508 bytes) - added by DJPaul 21 months ago.

Download all attachments as: .zip

Change History (7)

comment:1 DJPaul21 months ago

  • Component changed from Core to XProfile
  • Milestone changed from Awaiting Review to 1.6
  • Owner set to DJPaul
  • Status changed from new to assigned

comment:2 DJPaul21 months ago

The problem is easy to recreate if you change the user_id column to 0, of a record in the bp_xprofile_data table. I cannot find a way of deleting a user through wp-admin that, instead of deleting the user's profile data, does an UPDATE and sets the user_id to 0. That part we may have to come back to in the future/1.7 when we have more time to investigate.

4362.01.patch stops fetching xprofile data when user_id = 0. This was caused by bp_displayed_user_id() returning zero if no user is displayed or logged in. Suggest this for branch and trunk.

I tried to do something like this in the update_1_6() function to tidy up orphaned xprofile data, but most of BuddyPress isn't loaded. Maybe for a future release?

		// Delete orphaned xprofile data. See #4362.
		if ( bp_is_active( 'xprofile' ) )
			BP_XProfile_ProfileData::delete_data_for_user( 0 );

DJPaul21 months ago

comment:3 johnjamesjacoby21 months ago

  • Keywords commit added

Patch looks good. Makes sense not to look for profile data on an empty ID.

comment:4 djpaul21 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [6187]) Don't try to fetch profile data for user_id=0. Fixes #4362.

  • This fixes a problem where a (deleted) user's profile information was being shown on the registration template.
  • We still need to investigate why profile data record gets orphaned like this.

comment:5 cnorris2321 months ago

I noticed user_id = 0 on an install I've managed since 1.2 launched. I don't know if that's the case for shanebp. I was never able to track down the cause, but it only seemed to be happening in the early 1.2.x days, and it seemed like it was happening on registration, rather than a profile edit.

comment:6 johnjamesjacoby6 months ago

In 7488:

When loading profile fields for registration, do not attempt to fetch field data. See #4362.

Note: See TracTickets for help on using tickets.