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)
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | validateage_2.diff | 4.16 KB | xibun |
| #8 | validateage_editdump.dafeder.txt | 3.95 KB | dafeder |
| #7 | validateage_cck2.diff | 3.6 KB | dafeder |
| #1 | validateage.diff | 3.78 KB | xibun |
Comments
Comment #1
xibun commentedhave created the patch myself with some external help. please update the dev version.
Comment #2
gwen commentedI 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.
Comment #3
Tally commentedI 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.
Comment #4
halloffame commentedI 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!
Comment #5
dafederThis 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?
Comment #6
xibun commented@ dafeder: can you send me your patched file & settings?
Comment #7
dafederHere 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.
Comment #8
dafederxibun 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..
Comment #9
LatinBoy commentedThis is what i was looking for! Thanks xibun and dafeder! I'm gonna try it!
Comment #10
LatinBoy commentedI 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?
Comment #11
xibun commented@LatinBoy: what exactly do you agree with evilgenius's comment? his statement is: "good!". so you think it is RTBC?
Comment #12
LatinBoy commentedYes! 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!
Comment #13
xibun commented@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
Comment #14
gwen commentedOkay, it's taken me forever, but I finally got back to working on this module and have incorporated the patch, which should be available once the packaging script does its thing. Thanks to everyone for their hard work making this happen.
Comment #15
YK85 commentedHello,
Does this work with the cck date field? I am using this to have users select their date of birth and using cck computed field to compute the age from the date of birth.
Thanks
Comment #16
xibun commentedHi yaz085,
see my coment @dafeder in post #13.
cheers
Comment #17
YK85 commentedAhh sorry I missed that comment.
Thanks for kindly referring me to it
Regards
Comment #18
YK85 commented@dafeder - I have opened a new feature request for compatibility with cck at #705432: CCK compatibility
I hope your work can be continued there. Many thanks!
Comment #19
Babalu commentedpatch #13 not working with the new dev version of validateage :(
can someone make a working one ?
Comment #20
Babalu commentedhmm ..... :(
Comment #21
xibun commentedwell Babalu... you don't need to apply a patch that is already applied... just use the latest version. cheers.
Comment #22
Babalu commentedoh ok, thanks for the info. I couldn't read that anywhere or that this patch is ported