Skip to:
Content

Opened 18 months ago

Closed 18 months ago

Last modified 18 months ago

#7351 closed defect (bug) (fixed)

Empty date profile fields can return the epoch date

Reported by: nickmomrik Owned by: djpaul
Milestone: 2.7.3 Priority: normal
Severity: normal Version: 2.7.2
Component: Extended Profile Keywords: has-patch
Cc:

Description

If you call something like
$date = bp_get_profile_field_data( array( 'user_id' => bp_get_member_user_id(), 'field' => $id ) );
and the user hasn't filled anything in the field, you get back '1970-01-01' if you have 'Y-m-d' as the field's date format.

Before 2.7 this returned an empty string.

Attachments (1)

empty-profile-date.diff (579 bytes) - added by nickmomrik 18 months ago.

Download all attachments as: .zip

Change History (7)

#1 @DJPaul
18 months ago

  • Milestone changed from Awaiting Review to 2.7.3

This ticket was mentioned in Slack in #buddypress by slaffik. View the logs.


18 months ago

#3 @DJPaul
18 months ago

@nickmomrik Hi, I hope you're well. Thanks for the patch -- it's a good fix, and the issue is as you described.

#4 @djpaul
18 months ago

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

In 11252:

xprofile: fix valueless datebox profile fields erroneously returning the unix epoch.

Fixes #7351 (branch 2.7)

Props nickmomrik

#5 @djpaul
18 months ago

In 11253:

xprofile: fix valueless datebox profile fields erroneously returning the unix epoch.

Fixes #7351

Props nickmomrik

This ticket was mentioned in Slack in #buddypress by djpaul. View the logs.


18 months ago

Note: See TracTickets for help on using tickets.