Skip to:
Content

BuddyPress.org

Opened 13 years ago

Closed 13 years ago

Last modified 11 years ago

#3378 closed defect (bug) (fixed)

Fix submitted values for text(area) and dropdown xprofile fields during registration

Reported by: r-a-y's profile r-a-y Owned by:
Milestone: 1.5 Priority: normal
Severity: normal Version: 1.5
Component: Extended Profile Keywords: has-patch
Cc:

Description

During registration, if you have a required text, textarea, selectbox or multi-selectbox xprofile field filled in and you do not successfully complete the form, on submission, these values are wiped out forcing the user to fill in the respective fields again.

The (multi)selectbox error has existed since BP 1.2; the
textbox / textarea error is actually a regression from BP 1.2.

Attached patch attempts to fix these issues and also finetunes a few more "for" loops missed from #2985.

Attachments (1)

3378.01.patch (6.2 KB) - added by r-a-y 13 years ago.

Download all attachments as: .zip

Change History (5)

@r-a-y
13 years ago

#1 @DJPaul
13 years ago

  • Milestone changed from Awaiting Review to 1.3

#2 @DJPaul
13 years ago

Thanks for this. I've tested it and fixed a few PHP warnings which I found.

I've also fixed a bug in (optional) text fields where, if another (required) field failed validation, it was restoring the value of that optional text field. Finally, I've changed the behaviour of the single-item select boxes to *not* show the "---" option if it is a required field, as it didn't make sense; picking it failed the form validation.

Version 0, edited 13 years ago by DJPaul (next)

#3 @djpaul
13 years ago

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

(In [4831]) Fix profile field value handling of existing settings and new values when form submission fails validation. Props r-a-y for patch.
Change select box behaviour to not show "---" placeholder when field is required.
Fixes #3378

#4 @djpaul
11 years ago

In 7599:

XProfile: Show the placeholder text for all select box profile fields.

Prior to BP 1.5, the "----" placeholder item for select boxes was shown for both optional and mandatory fields. In BP 1.5 in r4831, the behaviour was changed to only show the placeholder item for optional profile fields. With retrospect, that change didn’t make much sense.

This commits restores the original behaviour, showing the placeholder text for all select box profile fields. A user should be forced to pick an option for a required profile field, and not allow the web browser to automatically select the first option in the <select> element.

See #3378, #3698, and #5184. Props haykayltduk, hnla, DJPaul at WordCamp London contributor day!

Note: See TracTickets for help on using tickets.