Social Insurance field validation always fails

dooug - April 8, 2009 - 16:11
Project:Social Insurance Number (CCK)
Version:6.x-2.5
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:needs review
Description

Drupal 6.10, Content 6.x-2.2, SIN 6.x-2.5

"999-99-9999" is not a valid US Social Insurance Numbers
Social Insurance Numbers should be like 999-99-9999 or 999999999 ...

I looked into the code and found a minor bug. It seems the valid_sin_number and format_sin_number were checking if functions exist in the form valid_xx_sin_number or format_xx_sin_number, and the functions defined in the .inc files are valid_xx_sin or format_xx_sin.

Attached is the patch,

AttachmentSize
sin.patch1006 bytes

#1

dibbd - April 12, 2009 - 12:15

How do you apply the patch? Just copy it to the SIN module folder or do you have to extract it somehow?

#2

dooug - April 15, 2009 - 17:00

There is some instruction in the handbook on applying patches:
http://drupal.org/node/60108

Change to the sin module directory, upload/copy the sin.patch file there and use the command: patch < sin.patch (I used GIT to create the patch, but it should still work.)

Or, since this particular patch is quite minor, you could probably just look at the patch file and manually make the changes to the code.

 
 

Drupal is a registered trademark of Dries Buytaert.