#5595 closed defect (bug) (fixed)
XProfile: Required fields do not show error message on failure
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 2.0.1 | Priority: | normal |
Severity: | major | Version: | 2.0 |
Component: | Extended Profile | Keywords: | has-patch commit |
Cc: |
Description
Reported here:
http://buddypress.org/support/topic/registration-form-with-extended-fields-required-fields-left-blank-issue/
Steps to duplicate:
- Navigate to "Register" page
- Leave the "Name" xprofile field blank
- Submit the form
- No error message is shown
On BP 1.9, a "This is a required field"
message was shown when a required field isn't filled out. BP 2.0 does not show this message.
The problem appears to be the omission of the <?php do_action( bp_get_the_profile_field_errors_action() ); ?>
hook when rendering the HTML for the fields.
Attached patch adds these hooks during the xprofile field HTML generation.
Attachments (1)
Change History (9)
#2
@
11 years ago
I want to look at how this regression occurred before we put this fix in, please. I'll look at that this evening.
#3
@
11 years ago
This is one of those quirks that existed only in the registration template files, and nowhere else. My bad for missing it.
Ray's patch amends the line to each field type's edit_field_html()
which is the right place, but adding anything here will also appear in the user profile/edit and the wp-admin profile/edit templates. I don't know if this matters, but it is a change.
I can only find the action used in bp_core_screen_signup()
. Triggering form validation on the user profile/edit screen doesn't result in two messages, so I guess the patch is OK. Sometime in the future we should probably move the registration action over to use the validation messaging that the rest of the profile screens use.
#4
@
11 years ago
Sometime in the future we should probably move the registration action over to use the validation messaging that the rest of the profile screens use.
Yeah, this seems right.
If we're worried about the inconsistency, and want a more conservative fix for 2.0.1, we could only fire the action if ( bp_is_register_page() )
. Not very elegant, but more targeted.
#5
@
11 years ago
Ray's patch amends the line to each field type's edit_field_html() which is the right place, but adding anything here will also appear in the user profile/edit and the wp-admin profile/edit templates.
The admin dashboard user profile uses a different method - admin_field_html()
- to output the xprofile field HTML. So this patch only affects the frontend.
If we're worried about the inconsistency, and want a more conservative fix for 2.0.1, we could only fire the action if ( bp_is_register_page() )
Right, perhaps the registration page check and go directly in the bp_get_the_profile_field_errors_action()
function?
#6
@
11 years ago
As stated previously, I think the current patch is OK; my comments were just to flag that we're firing an action in a different place than where we did in previous versions of BuddyPress, and the (seemingly unimportant) consequences of, for discussion.
Good catch.