I have two roles: One is wide open (including field-level content access permission to "edit field_school1_contact_phone"). The other limited role does NOT have said permission.

The data in the field may include extension data, e.g. 3135551234 x6789. The format mask adhered to on the screen is (313) 555-1234 x6789.

Attempts to save the node by the limited role always yields a phone number data validation error, complaining:

"3135551234 x6789" is not a valid North American phone number
North American Phone numbers should only contain numbers and + and - and ( and ) and spaces and be like 999-999-9999. Please enter a valid ten-digit phone number with optional extension.

Remember, the form as displayed to the limited role does not even show the field! It does not have permission to.

I've traced this back to the phone_field() hook's 'validate' op. There, a look into $item['value'] on this would-be-restricted field reveals that the field's value is in fact "3135551234 x6789", and not "(313) 555-1234 x6789".

I temporarily have changed line 249 in phone.module from

if ($item['value'] != '') {

to

if (($item['value'] != '') && (user_access('edit ' . $field['field_name'])))

to deal with the fact that the user may not have edit access to the field. With that, my immediate problem goes away.

But as I suspect this patch is predicated on use of the content_access module, I am all but sure that this is the wrong way to patch phone.module.

In fact, why is this field even being validated at all, if the user is not supposed to have access to it?

And with that I'm just slightly out of my league - Can anyone hint at a more proper fix?

-Brian