Opened 15 years ago
Closed 13 years ago
#2240 closed defect (bug) (fixed)
Unix epoch is not accepted in date field values [Has Patch]
Reported by: | francescolaffi | Owned by: | |
---|---|---|---|
Milestone: | 1.5 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Extended Profile | Keywords: | has-patch dev-feedback |
Cc: | francescolaffi |
Description
either in registration or edit profile date fields unix time epoch (1-1-1970) is said to be invalid / not processed. 0 is a valid strtotime return value, but the validation code check every field with empty() so it says it is not valid.
patching should be easy, I'll upload diff soon
Attachments (7)
Change History (34)
#2
@
15 years ago
- Keywords reporter-feedback added
So are you saying that you're entering "0" as the date, instead of "1-1-1970"?
#3
@
15 years ago
- Keywords reporter-feedback removed
I'm selecting 1 jan 1970 from the dropdown fields in registration or edit profile page, then the core convert it to a timestamp with strtotime function for better handling and storing in the db. The problem is that the timestamp of 1-1-1970 is 0 and the core validate all values with empty function, so 0 is not accepted.
#4
@
15 years ago
Ah, I see. I thought you were saying you were entering 0, which would be a fringe case. This is definitely a problem since it's basically saying you couldn't have possibly been born that day :). From your patch, it looks like tested this on BP trunk. Is this also an issue in the 1.2.x branch?
#5
@
15 years ago
Yes also 1.2 branch has this issue. If a dev set the milestone to 1.2.4 the patch can be easily changed for that.
#6
@
15 years ago
I would go ahead and update the patch for the 1.2.x branch, and set the milestone for 1.2.4. The devs can punt it if they don't feel it should go in.
#7
follow-up:
↓ 8
@
15 years ago
- Keywords has-patch removed
- Milestone set to 1.3
Patch needs updating and issue confirming in trunk.
#9
@
15 years ago
- Keywords has-patch added
- Summary changed from Unix epoch is not accepted in date field values to Unix epoch is not accepted in date field values [Has Patch]
#10
@
14 years ago
- Summary changed from Unix epoch is not accepted in date field values [Has Patch] to [patch] Unix epoch is not accepted in date field values [Has Patch]
#11
follow-up:
↓ 12
@
14 years ago
What if we just stored the date in 2010-11-23 20:04:25 type format instead of in unix seconds? That seems easier than trying to write replacements for core PHP functions like empty()
#12
in reply to:
↑ 11
@
14 years ago
- Owner francescolaffi deleted
- Status changed from new to assigned
Replying to boonebgorges:
What if we just stored the date in 2010-11-23 20:04:25 type format instead of in unix seconds? That seems easier than trying to write replacements for core PHP functions like empty()
@boone: Yep that sound a good solution
With regret I remove myself as owner, this year in uni is more difficult than expected and I'll not have time to write another patch :(
#14
@
14 years ago
- Keywords needs-patch added; unix epoch date field dev-feedback has-patch removed
- Summary changed from [patch] Unix epoch is not accepted in date field values [Has Patch] to Unix epoch is not accepted in date field values [Has Patch]
#17
@
14 years ago
Per boone's suggestion I've changed the date from a Unix time stamp to a MySQL time stamp. I've added in some backwards compatibility for existing Unix timestamps, and some minor comment cleanup. The succeeding patch was made to work with #2947.
#19
@
14 years ago
- Keywords needs-patch added; has-patch removed
This patch needs updating based on changes in [3651]. This is more for me, so I'll remember to update the patch... hopefully tonight.
#20
@
14 years ago
- Keywords has-patch dev-feedback added; needs-patch removed
Patch updated for current trunk.
#21
@
13 years ago
- Milestone changed from 1.6 to 1.5
- Severity set to normal
Bringing to 1.5 since there's a patch, though I reserve the right to punt!
#22
@
13 years ago
Haha! It's been a while since the patch was refreshed, so unless you beat me to it, I'll take a look at it tonight.
#24
@
13 years ago
Confirmed that this issue still exists.
I think the easiest solution is to convert the value to date() as cnorris23 has it in bp-xprofile-screens.php.
006.patch adds this same logic to bp-members-signup.php.
proposed patch