I was excited to find this module until I realized that I would need to add a separate phone field for every format I want to support. I think this module could be greatly improved by providing on the node/edit screen a combined a text field (for the phone number) and a drop down (for the format selection). If I missed something obvious, and what I am requesting is possible, forgive me. I however was unable to achieve this functionality and will have to revert to a text field. Thanks for the work thus far, hope my suggestion is helpful.

Cheers,

Antoine

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

madrush’s picture

I would agree with the above comment. Also, an additional field for an extension (in case one exists) would be a good addition.

patcon’s picture

Or integration with location, so that the enforced format varied with the country. Could replace Location Phone.

roball’s picture

I also uninstalled this module after realizing this. Using usual text fields for phone fields again. This module sure could be useful, but with the current design it is very limited and pollutes CCK due to the bunch of options it adds.

AaronBauman’s picture

+1
This module is not useful if i have to assign tie the data type to a country when i'm creating the cck field.
My users are selecting their country on the same form on which the phone field appears, so there's no way to know ahead of time which country is appropriate.

Also, adding 20+ field types to the CCK form is serious visual clutter.

If not integration with location module, what about a generic "Phone" field type that will perform validations for all the countries, or perhaps a configurable subset of countries, along with the option to accept any arbitrary value if the validation fails?

Sorry to be so negative, but this module was not at all what i was expecting based on the project description.

roball’s picture

@aaronbauman : You may want to use the Phone Number module instead. It's working fine for me.

AaronBauman’s picture

That looks like the ticket - thanks roball.

cweagans’s picture

cck_phone does offer that feature, yes. I'd like to implement something similar in this module, but I don't have the time to do it myself right now, so if anyone would like to try creating a patch against the 6.x version for this feature, I'd be interested in incorporating it.

cweagans’s picture

7.x version that is. New stuff should go into 7.x, then we can backport to 6.x.

Ben Coleman’s picture

One other possibility might be to include integration with the Country part of the Address field (http://drupal.org/project/addressfield), at least in the D7 version. It's going to be a common thing to capture both postal address and phone numbers, and addressfield already captures the country (and uses it to change address formats). An option to tie to the address field and use the country from it would be useful.

Exploratus’s picture

I think #9 is going somewhere. I also uninstalled because of this. I have global users.

warmth’s picture

Any news?

amit.drupal’s picture

Create any Single phone field .
Datetype of phone field - Integer
Write js code for this field -

jQuery("#edit-submitted-business-phone").bind('focusout',function() {
//alert('hello');
var mnumber = document.getElementById('edit-submitted-business-phone').value;
//alert(mnumber);
if(mnumber.length >16) {
alert('Number Should be in 10 or 13 digits only');
document.getElementById('edit-submitted-business-phone').value = "";
}else
{
var final = document.getElementById('edit-submitted-business-phone').value;
var monumber = final.replace("-","");
var monumber1 = monumber.replace("-","");
var monumber2 = monumber1.replace("-","");
var monumber3 = monumber2.replace("-","");
//var final1 = monumber.replace("+","");
document.getElementById('edit-submitted-business-phone').value = monumber3;
}
});

warmth’s picture

Is this Drupal friendly/way or just a workaround?

Nephele’s picture

Priority: Normal » Major

I'm changing the priority of this issue to major, because it's clearly the single reason why dozens of people can't use the module (me included). It appears to be the entire reason why a competing phone field module, namely cck_phone, was created nearly three years ago. Until this issue is addressed, any consideration of merging phone and cck_phone is pointless (#1812184: [meta] Rewrite and merge phone and cck_phone).

Furthermore, I think this is the key reason why drupal7 still does not have a stable phone field module. This issue is dividing the community between two separate modules. Even worse, I think it discourages most programmers from getting involved in writing/reviewing/etc patches, because there's a 50/50 chance that you're investing your time in the wrong module -- I know it has discouraged me for the past two years.

cweagans’s picture

Status: Active » Fixed

#1812184: [meta] Rewrite and merge phone and cck_phone is now fixed. Check out 7.x-2.x, as it resolves this issue.

warmth’s picture

Hilarious, thanks!

Status: Fixed » Closed (fixed)

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

roball’s picture

Version: master » 7.x-1.x-dev
Issue summary: View changes
Status: Closed (fixed) » Active

Does not seem to be fixed because meanwhile 7.x-2.x has been unpublished, so the latest D7 release is 7.x-1.0-beta1.

roderik’s picture

Status: Active » Needs review
FileSize
8.29 KB
27.72 KB

Here ya go.

This does not add a country dropdown to the phone field directly; it adds support to tie a relationship to an existing field on the same entity, and use that as input for the country.
I don't think that Phone CCK or Phone v2.x currently have this option. (Meaning: this functionality should be forward-ported to 2.x!)

You have to set the field setting to "International" in order to get the option in the instance settings, to tie to a separate field for the country.
It also supports addressfields, as per #9. This is what I built the patch for / need, myself.

(I didn't test it for multi-value fields, but it should work. In this way: your 2nd phone number will tie to the 2nd field value of the linked field. If that is not present, e.g. if the linked field is single-value, it will keep the 'default' country code, being "int".)

In order to use this patch, you must first apply:

Since the separate patch for #2108715-2 will not apply if you apply the patches separately, I include a patch from my git repo where I merged all 4.

sk2013’s picture

Any updates on a new DEV version ?

Thanks,