The Phone Number field module provides a simple field that allows you to add a national or internation phone number to a content type and it validate the phone number using Byteplant API (http://www.phone-validator.net/). This is an paid service and there is a limit to the numbers of free checks you obtain.

Sandbox Project Link - https://drupal.org/sandbox/singh-nitin/2179805

git clone --branch 7.x-1.x http://git.drupal.org/sandbox/singh-nitin/2179805.git phone_number_field

The main difference from Phone number, Telephone modules is, in this module we use Byteplant API to validate the number. That service is available not only for the US and Canada, they offer complete, full-service validation for any national or international phone number.

Comments

PA robot’s picture

Multiple Applications
It appears that there have been multiple project applications opened under your username:

Project 1: https://drupal.org/node/2181337

Project 2: https://drupal.org/node/2095707

As successful completion of the project application process results in the applicant being granted the 'Create Full Projects' permission, there is no need to take multiple applications through the process. Once the first application has been successfully approved, then the applicant can promote other projects without review. Because of this, posting multiple applications is not necessary, and results in additional workload for reviewers ... which in turn results in longer wait times for everyone in the queue. With this in mind, your secondary applications have been marked as 'closed(duplicate)', with only one application left open (chosen at random).

If you prefer that we proceed through this review process with a different application than the one which was left open, then feel free to close the 'open' application as a duplicate, and re-open one of the project applications which had been closed.

I'm a robot and this is an automated message from Project Applications Scraper.

PA robot’s picture

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

markaspot’s picture

Status: Needs review » Needs work

Hi, I just read about the multipiple project applications. This is the one which has status "Needs review", so I start:

I wonder if this module is going to compete with other module which provide a phone field type. I found some [1] [2][3], but all of them did not provide that form of online-validation against an API. That's cool :)

Actually I think that the validation function is the main feature. Maybe you can provide the API based validation in a more generic way, like making it available to other field types, too?

Not sure about that, but you choose file_get_contents in phone_number_field.module (line 201) to make the API request. Better practice could be to use drupal_http_request instead.

Just another hint: You could provide more information about how retrieving an API Key and the connected Service in the configuration settings at /admin/config/content/phone_number

[1] https://drupal.org/project/addressfield_phone
[2] https://drupal.org/project/phone
[3] https://drupal.org/project/telephone

nitinsingh’s picture

Status: Needs work » Needs review

Hi
Now, I have used 'drupal_http_request' function in place of 'file_get_contents' and also add a hint on configuration page.
I am thinking of building a separate module in this module which have a api to validate the phone number but not sure that is good idea or not.

Perignon’s picture

Question. What is the logic behind not contributing to the Addressfield module for phone numbers? Addressfield is so integral to so many other supporting modules for Drupal. This is the reason I pose the question.

nitinsingh’s picture

The only reason behind it, Phone number is a different entity. Some time we need phone number with address some time not. If somebody wants a phone number only he/she can use this module.

jribeiro’s picture

I think that is unnecessary the part of the validation as you mentioned, I would create another module for this, I do not know what to do this validation, but the module will be used in several countries that do not follow the american standard.

Code Standards:
FILE: phone_number_field.install
--------------------------------------------------------------------------------
FOUND 1 ERROR(S) AFFECTING 1 LINE(S)
--------------------------------------------------------------------------------
18 | ERROR | Multi-line array contains a single value; use single-line array
| | instead
--------------------------------------------------------------------------------

FILE: phone_number_field.module
--------------------------------------------------------------------------------
FOUND 1 ERROR(S) AFFECTING 1 LINE(S)
--------------------------------------------------------------------------------
69 | ERROR | Multi-line array contains a single value; use single-line array
| | instead
--------------------------------------------------------------------------------

nitinsingh’s picture

I have created this module, because some time developer need to validate the phone number. I had already used this in our 3-4 projects.

There is no error found if I am using http://pareview.sh/ to review the code.

Also I have checked this with US number, it works perfectly.

If you are facing any problem to validate the number, can you please share the number? so I can check that also and see what is the issue.

rmn’s picture

Status: Needs review » Needs work

@Jean I am not able to see any errors on pareview.sh as well, can you please specify the tool you are using to test the module?

@Nitin

  1. Please change the link to git repo in the summary above to the appropriate git command to make it easier for reviewers i.e. git clone --branch 7.x-1.x http://git.drupal.org/sandbox/singh-nitin/2179805.git phone_number_field
  2. Please specify if and how this is different from other similar modules like Phone Number, Telephone and Phone. Please update the project description page and summary too so reviewers know what to expect and users can make an educated choice.
nitinsingh’s picture

Issue summary: View changes
Status: Needs work » Needs review

I have changed the link and specify the difference in the summary.

Also, later we can use that API to track other things, the response of that API includes

  • Status: Valid or invalid
  • Line type: Fixed line, mobile, VoIP, pager etc.
  • Geo-location: Region and city
  • Phone number correction and re-formatting according to national and international standards
jribeiro’s picture

I'm using local code sniffer tool, but do not worry, the requirement is to run pareview.sh, where no errors were found.

One question, if the core functionality of the module is to validate phone numbers by www.phone-validator.net, why not create a module associated with this service?
Exemple: phone_validator_net

davidmac’s picture

Status: Needs review » Needs work

I think you should amend the description in the issue summary and the sandbox page (and/or documentation) to make it clear that this module provides an integration/API of a paid service and that there is a limit to the number of free checks a user can obtain. You should also update the text in your hook_help() function to explain this crucial point.

You don't seem to have addressed question No. 2 from comment #9, please could you do so. I would refer you back to comment #1 and your other project Drag Drop Blocks which also raised issues of duplication, a project/issue which was not resolved prior to opening this one. It would have been good form to inform reviewers of your other project that you intended to open another application instead of leaving it hanging like that.

Although you may be able to show that this module provides unique functionality, you must address the questions put to you regarding duplication, as this is an inportant and valid concern on Drupal.org.

Also can you confirm whether or not you intend to publish your other project (Drag Drop Blocks) if you receive Git vetted approval via this issue application.

nitinsingh’s picture

Issue summary: View changes
nitinsingh’s picture

Status: Needs work » Needs review

I have updated the all the three places

  • Issue summary
  • Sandbox page
  • hook_help

I have already mentioned the difference in the issue summary. For your reference -

The main difference from Phone number, Telephone modules is, in this module we use Byteplant API to validate the number. That service is available not only for the US and Canada, they offer complete, full-service validation for any national or international phone number.

Actually I don't know about that, we can submit only one project at a time, so I have created another one. I really wants to publish that module also but my priority is this one.

davidmac’s picture

Nitin,

Thank you for your response, however the question asked you to provide a comparison with three projects including the Phone module which also provides international phone number validation. Just because it integrates an API doesn't make it unique, if it still provides the same functionality as the Phone module i.e. checking if phone numbers are valid, in that case it would duplicate another module's functionality.

Please review the Project Application Checklist and remember that you should provide a coherent explanation regarding duplication of functionality. I remind you that you have already been advised of all of these considerations in your other application issue, which also had issues regarding duplication of functionality, but which you have not addressed adequately.

In this respect, you say you really want to publish it, which suggests that you intend to, and you are aware that only one project is allowed at a time. So the obvious question is why did you not complete the review process for your original application before opening this one, and do you intend to correct the problems that I and others have identified in that application issue. Please be thorough with your response.

Also there is a Q&A format to issue applications, so you should follow that instead of moving your responses to the issue summary.

Leaving at NR for the time being, but please don't forget to respond to all of the above.

nitinsingh’s picture

Difference from Phone module are -

Phone module validate only for some countries (like not for India) and generic international phone numbers, but this module validate for all the countries using the Byteplant APIs. We can get the country code, location and line type (mobile, land line etc.) from this API.

As I mentioned, I am not aware that I should not open another project. Once I need to close one and than open another. So now I want to close this and than start working on previous one.

I changed the summary because in some comments reviewer ask me to add that.

davidmac’s picture

With respect to the issue of duplication. In this case, I think you have shown that this module is not a duplicate.

However, please try not to get into the habit of making reviewers repeat questions, as follows.

from #15

do you intend to correct the problems that I and others have identified in that application issue [Drag Drop Blocks]. before you publish it ?

The reason for the question is because you were advised that there were significant issues which needed to be addressed in your overlapping project and instead of fixing them you chose this other route to approval.

Any approval of this application means that you also get approval to publish the other one, even though it requires a lot of work. Normally, as part of the approval process, you show that you can be relied upon to publish well written modules, and you need to provide some assurance that you can be relied upon in this respect.

nitinsingh’s picture

Ok, I will do the fixes of old application first.

davidmac’s picture

To a large extent, it is up to you, however I think you have complicated matters by not finishing and not closing your other project (it was closed by the PA robot). As reviewers, we cannot force you to reopen the other project and you are allowed to continue with this issue application as your path to Git vetted approval. However, you should show that you understand the reasons why the other project is not acceptable in its current state. There is also a question remaining over the other project with regard to duplication, so I would not encourage you to continue to work on it until that issue is resolved, or until you amend its functionality/feature set.

If you do decide to pursue the other project, you should close this issue and reopen the other.

garethhallnz’s picture

It's best practice to use the l() function

Perhaps look at changing #14 in phone_number_field.admin.inc to use the l() function?

heddn’s picture

If the main differentiator between this and the phone module is its validation, why couldn't this project be restructured to extend phone and add additional field validation? Probably the project would need to be renamed to phone_byteplant, unless it is intended to integrate with multiple phone number validation services, in which case it could be called phone_validation.

joachim’s picture

+1 to the suggestion in comment #21.

Creating this as a separate field type forces your users to make the choice to use this validation during site set-up, and locks them in. That's not very good DX. Much better to have the validation service something you can add to existing fields.

nitinsingh’s picture

Thanks for your valuable suggestion, I will be working on it and submit again.

keopx’s picture

Status: Needs review » Needs work

Hi,

I used to a existing phone number but reaches this, revise it please, there are a spanish phone number, for example 944050088 (house) and 630100555 (mobile).

Please into phone_number_field.info put configure = admin/config/content/phone_number to facility setup API key.

I don't see any message to tell to configure module API key.... :-/

nitinsingh’s picture

Hi,

you have add +34 as country code (Spain country code) with the number.

keopx’s picture

Hi

Yes, I do, but doesn't work for me.

PA robot’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).

I'm a robot and this is an automated message from Project Applications Scraper.