Australian Support

whea - January 19, 2008 - 08:07
Project:CCK Address Extensions
Version:5.x-1.x-dev
Component:Other
Category:feature request
Priority:critical
Assigned:Unassigned
Status:active
Description

Hi, I don't know how to get involved with this project, so I just setup Australian state support for CCK_Address.
Attached is a zip file of the files which I have created for Australian support.

If possible could you please create a directory 'australia' and add these files to the next release.

Thanks,
Michael Wheatland
http://www.aussiebikes.com
http://www.drinkable.com.au

AttachmentSize
australia.tar_.gz2.78 KB

#1

rconstantine - January 19, 2008 - 08:42

This is how you do it. So thanks for the post. Currently, releases are on freeze because of a problem with the CVS directory for this project. But I will review it and if everything checks out, I will include it. Otherwise, I'll post changes that need to be made here if I don't have time to take care of them myself.

#2

whea - January 21, 2008 - 07:57

Sorry, I just realised that the postcode (zip) was not validating correctly.
As I am very new to PHP I just fudged it in the newly attached files to make sure any symbols are not included. However it would be good if it would validate a 4 (four) digit zip.

See attached files for the update that makes it (kind of) work.

AttachmentSize
australia.tar_.gz 2.71 KB

#3

rastarr - January 21, 2008 - 08:20

Nice to see other Aussies using Drupal :)
Look forward to the Aust states being added too - well done.

#4

rconstantine - January 21, 2008 - 18:59

If you do an google search for "Australia postal code regex" or something like that, you'll probably find what your regex should be for the zip. Are your digits all numbers, are all values possible in each column? Those are the kinds of things your regex should take into account for validation. I still haven't gotten around to looking at your code yet. Am I to understand from comment #3 that there aren't states (territories or whatever you call them in Australia) in your module as it is now?

#5

matteusx - September 19, 2008 - 20:19

rconstantine: It appears the territories are included here.

whea:

This regex will require 4 digits:

[0-9]{4}

and I've made line 108:

if (($item['zip'] != '') && (!preg_match("/^[0-9]{4}$/", $item['zip']))) {

Thanks for your work on this! If I make any other changes I will post a patch.

- Matt

 
 

Drupal is a registered trademark of Dries Buytaert.