#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: | Extended Profile | 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."
Attachments (1)
Change History (7)
#1
@
12 years 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
#3
@
12 years ago
- Keywords commit added
Patch looks good. Makes sense not to look for profile data on an empty ID.
#5
@
12 years 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.
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?