I dont know if its only me or anyone else have the same problem but the required option doesnt work for my setup.
Even if it is checked, I can create new content without entering a phone number.

Thanks..

CommentFileSizeAuthor
#5 field-required-1316244-5.patch518 bytesjantoine

Comments

Ari Gold’s picture

I have the same problem. I'm using US & Canada phone number...

jens.de.geit’s picture

same over here with Belgium is there a patch for this available?

flightrisk’s picture

Same here, I was just coming to post the issue and see you already started it. I've been using the module since October but just saw that this wasn't working and help wasn't displaying. There is a fix for the help issue in a patch.

flightrisk’s picture

Ok, I looked at the code and fixed it myself. Give it a test. I don't have time to create a patch, sorry. Perhaps someone else can and then submit it. It is a 1 line change. Look in the phone.module file at or near line 227 for the form_field_widget_form function. You need to add a line. The line with the '+' in front is what you need to add:

function phone_field_widget_form(&$form, &$form_state, $field, $instance, $langcode, $items, $delta, $element) {
$element['value'] = array(
'#type' => 'textfield',
'#title' => $element['#title'],
'#description' => $element['#description'],
'#default_value' => isset($items[$delta]['value']) ? $items[$delta]['value'] : '',
+ '#required' => $element['#required'],
'#size' => 17,
'#maxlength' => (

Note that if you don't have the '#description...' line in there, add that too to fix the popup help instructions for the field which also weren't working in my version.

jantoine’s picture

Status: Active » Needs review
StatusFileSize
new518 bytes

A patch including the fix in #4 is attached.

cweagans’s picture

Status: Needs review » Fixed

Committed. Thanks!

flightrisk’s picture

Excellent everybody, teamwork! ;) If nobody finds an issue, guess we can close this one

Status: Fixed » Closed (fixed)

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