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)

Comments

xibun’s picture

Title: Option to validate existing date field » Option to validate existing profile date field
Category: feature » task
Status: Active » Needs review
StatusFileSize
new3.78 KB

have created the patch myself with some external help. please update the dev version.

gwen’s picture

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.

Tally’s picture

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.

halloffame’s picture

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!

dafeder’s picture

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?

xibun’s picture

@ dafeder: can you send me your patched file & settings?

dafeder’s picture

StatusFileSize
new3.6 KB

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.

dafeder’s picture

StatusFileSize
new3.95 KB

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..

LatinBoy’s picture

This is what i was looking for! Thanks xibun and dafeder! I'm gonna try it!

LatinBoy’s picture

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?

xibun’s picture

@LatinBoy: what exactly do you agree with evilgenius's comment? his statement is: "good!". so you think it is RTBC?

LatinBoy’s picture

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!

xibun’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new4.16 KB

@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

gwen’s picture

Status: Reviewed & tested by the community » Fixed

Okay, 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.

YK85’s picture

Hello,

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

xibun’s picture

Hi yaz085,

see my coment @dafeder in post #13.

cheers

YK85’s picture

Ahh sorry I missed that comment.
Thanks for kindly referring me to it

Regards

YK85’s picture

@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!

Babalu’s picture

patch #13 not working with the new dev version of validateage :(
can someone make a working one ?

Babalu’s picture

hmm ..... :(

xibun’s picture

well Babalu... you don't need to apply a patch that is already applied... just use the latest version. cheers.

Babalu’s picture

oh ok, thanks for the info. I couldn't read that anywhere or that this patch is ported

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.