Skip to:
Content

BuddyPress.org

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#5595 closed defect (bug) (fixed)

XProfile: Required fields do not show error message on failure

Reported by: r-a-y's profile r-a-y Owned by: djpaul's profile djpaul
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)

5595.01.patch (3.6 KB) - added by r-a-y 11 years ago.

Download all attachments as: .zip

Change History (9)

@r-a-y
11 years ago

#1 @boonebgorges
11 years ago

  • Keywords commit added

Good catch.

#2 @DJPaul
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 @DJPaul
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 @boonebgorges
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 @r-a-y
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 @DJPaul
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.

#7 @djpaul
11 years ago

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

In 8338:

xProfile: fix profile field validation messages not showing on registration template.

Fixes #5595, props r-a-y

#8 @djpaul
11 years ago

In 8339:

xProfile: fix profile field validation messages not showing on registration template.

Fixes #5595 for the 2.0 branch, props r-a-y

Note: See TracTickets for help on using tickets.