-
Notifications
You must be signed in to change notification settings - Fork 252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Birthdate for those with no birthdates set #5911
Comments
Interesting. It's been like that for a while, part of supporting STRICT mode. I guess more folks are using this in production... The year 1004 is tied to certain logic, iirc, so we likely need to check > 1004. |
More history here, with links to other related prs: |
Allow null value and you got possibly to fix it right. |
This is also an issue in the Calendar if you have birthdays set to display. Interestingly, there was a year check there in 2.0, but removed in 2.1. I fixed it on my forum by copying it from the 2.0 code and changing year_one to '1004'. I don't have the code checked out so I can't submit a pull request, but here's the modified query. The quick fix in Subs-Calendar.php, getBirthdayRange(): $result = $smcFunc['db_query']('birthday_array', ' |
Description
The default birthdate column value in the smf_members table is 1004-01-01, that means that the software by default determines that all who have not set their birth dates, their birth dates are the 1st of January
Source code in question
I believe these are the two spots of the source code that we should tweak (add conditions that the year value must be upper than 1004 perhaps?), unless we want to edit the column's default value.
Line 81 of Profile-View.php
https://github.com/SimpleMachines/SMF2.1/blob/6007069567bd78d1a72dd56dc61590a074258be4/Sources/Profile-View.php#L79-L82
And the query in the birthday scheduled task
https://github.com/SimpleMachines/SMF2.1/blob/6007069567bd78d1a72dd56dc61590a074258be4/Sources/tasks/Birthday-Notify.php#L31-L48
Additional information/references
https://www.simplemachines.org/community/index.php?topic=571106.0
https://www.simplemachines.org/community/index.php?topic=571108.0
The text was updated successfully, but these errors were encountered: