Skip to:
Content

BuddyPress.org

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#3630 closed defect (bug) (fixed)

Date Selector Bug

Reported by: ken_k Owned by:
Priority: normal Milestone: 1.5.2
Component: Core Version: 1.5
Severity: minor Keywords: has-patch commit
Cc:

Description

If you put a date selector in the Base profile and even though is set to required, can be bypassed during registration.

Attachments (1)

3630.01.patch (875 bytes ) - added by boonebgorges 15 years ago.

Download all attachments as: .zip

Change History (7)

#1 @boonebgorges
15 years ago

  • Milestone Awaiting Review1.5.1
  • Severity normalminor

Confirmed. The problem is that when you don't fill out the date selector, BP converts your null response to the (MySQL equivalent of) the UNIX epoch, so that WP thinks it's filled out. About to post a suggested solution.

#2 @boonebgorges
15 years ago

  • Keywords has-patch added

3630.01.patch is a quick fix. It does two things:

  • Switches isset() to !empty(). Previously, isset() always returned true, because the submitted dropdown passed an empty string as the value.
  • Checks to see that day, month, and year are all filled out, instead of just the day. Since we are setting the saved value using date(), we really should be requiring all three fields anyway. (I think there is a good argument for *not* requiring all three fields, but that would require a different method for saving stuff, and would be a future enhancement.)

If people are cool with this fix, I'll copy the logic over to the profile edit functions too (they're processed separately from registration fields).

#3 @DJPaul
15 years ago

  • Keywords commit added

Looks good

#4 @johnjamesjacoby
15 years ago

Looks okay to me.

#5 @boonebgorges
15 years ago

  • Resolutionfixed
  • Status newclosed

(In [5268]) Don't allow date-formatted xprofile fields to be saved if they're only partially filled in. Fixes #3630

#6 @boonebgorges
15 years ago

(In [5269]) Don't allow date-formatted xprofile fields to be saved if they're only partially filled in. Fixes #3630

Note: See TracTickets for help on using tickets.