Option to validate existing profile date field
xibun - March 5, 2009 - 12:05
| Project: | Validateage |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | reviewed & tested by the community |
Description
I have already a "Date of Birth" field generated by the profile.module. For my site I would prefer to enable the validation for that field.
Can we add an option to point to that field?
There is a similar feature in the birthday.module. (http://drupal.org/project/birthdays)

#1
have created the patch myself with some external help. please update the dev version.
#2
I don't have time right now to test the patch, but if some folks in the community feel like doing so, please update this issue once it's been done so I can know whether I should apply the patch or not. Otherwise, I'll test when I have a little more time.
#3
I installed the patch and tested it on a version 6.11 install. I am running the birthdays module and using a birthday field in my profile, which is based on the core profile module.
The patch seems to work OK with respect to integrating with the birthdate field in the profile.
Looking at the validateage table, I notice that new users are added, but the date fields are 0. This makes sense since the patch enables using a profile field for birthdate and that is what I am using.
#4
I installed the patch. It works ok but one thing I noticed is that I cannot change the the date of birth that's already filled, including mine. I logged in as user 1 (admin superuser) but still I cannot change any date of birth. I tested it in my development site and my date of birth is now stuck at year 2002!
Update: Disregard. Only true if the date I'm trying to update falls below my minimum age requirement.
So far so good! Hope to see stable version soon!
#5
This patch did not work for me, it accepted an age well below the minimum I'd set. I wonder why the module author decided to stop providing CCK support?
#6
@ dafeder: can you send me your patched file & settings?
#7
Here is a patch of the modifications I made. I suspect that the problem was due to a difference in date formats - the date field needs to be abstracted or something. This one doesn't look up the field name, just has "field_birthdate" hardcoded. Will try to come up with a better patch if there is more interest.
#8
xibun thanks for the response - I'm not sure which settings you're asking for but here is a dump of the $edit array that might be usefull..
#9
This is what i was looking for! Thanks xibun and dafeder! I'm gonna try it!
#10
I installed the patch (#1). I'm agree with evilgenius's comments. Also, I tried the last patch (#7) but it didn't work (I replaced "field_birthdate" with my field name). ¿Am i doing something wrong?
#11
@LatinBoy: what exactly do you agree with evilgenius's comment? his statement is: "good!". so you think it is RTBC?
#12
Yes! The first patch works for me . I'm using Drupal 6.14 and i don't see problems. For me, it is RTBC. thank u very much xibun for this patch!
#13
@Tally: thanks for pointing out the "empty" date entries added to the validateage table in case of profile date field usage - attached a new patch which removes this unnecessary "data collection"
@dafeder: this patch is about profile date field support, I know that CCK (actually fields) is the future, but this should be handled in a separate issue
@LatinBoy: I'm glad I was able to help :). you might also be interested in: #435308: Special message for users indicating current year's birthday
@gwen: I mark this RTBC as is has been confirmed to be working by three other users