Opened 16 years ago
Closed 16 years ago
#2963 closed defect (bug) (duplicate)
XProfile - Bugs with the type datebox
| Reported by: | calvin_42 | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.5 |
| Component: | Extended Profile | Version: | 1.5 |
| Severity: | Keywords: | ||
| Cc: |
Description
To record dates into the database, xprofile_screen_edit_profile() uses strtotime (Link).
The documentation stipulates :
''The valid range of a timestamp is typically from Fri, 13 Dec 1901 20:45:54 UTC to Tue, 19 Jan 2038 03:14:07 UTC''
There is 2 bugs in the current version of BuddyPress :
- bp_get_the_profile_field_options() doesn't take this limits in account (Link) and display years 1900 and 1901 which cannot be saved.
- If the user select the date January 1 1970, the strtotime result will be 0 and this value won't be saved because of the following test in xprofile_set_field_data() (Link)
/* If the value is empty, then delete any field data that exists */
if ( empty( $value ) ) {
xprofile_delete_field_data( $field_id, $user_id );
return true;
}
Moreover only the current and the past years are displayed. So the context is limited to displays birthdays or past events, not future ones.
IMHO, strtotime should be not used and the date should be serialized in string.
Change History (2)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
See also #2946 and #2947