The verification for dutch phone numbers generates an error. The call for the function preg_match uses a different syntax:

  preg_match('/(?P<areacode>[0]{1}[6]{1})[-\s]+(?P<localnumber>[1-9]{1}[\s]*([0-9]{1}[\s]*){7})/', $phonenumber, $matches);

The two 'P's are added.

Comments

Marcel.de.Haas’s picture

This occurs when the option is turned on to add the country prefix. You can submit the node when you add something like 033-1234567. This is converted to +31-33-1234567 which does not pass the check mechanism. When you add the zero again the check passes. I would like the field to be stored as entered and the parsing to occur on rendering.
Also the notation is not correct to the standard as defined by the Dutch Standards Association (NEN). For an excerpt see http://taaladvies.net/taal/advies/tekst/53/ (Dutch only)

oblomow’s picture

No, this option was not turned on. And none of the phone numbers I tried was accepted. with or w/o country prefix. Only AFTER I changed the code as mention above I can get the phone numbers accepted.

mohit_aghera’s picture

Have you got any solutions for your problem which is mentioned above...
because i have the same problem

mohit_aghera’s picture

I have got solution by customizing some of the code:
Original code:

$areacode = $localnumber = '';
	// Mobile number
	if (preg_match('/([0]{1}[6]{1}[-\s]+[1-9]{1}[\s]*([0-9]{1}[\s]*){7})/', $phonenumber)) {
		preg_match('/(?<areacode>[0]{1}[6]{1})[-\s]+(?<localnumber>[1-9]{1}[\s]*([0-9]{1}[\s]*){7})/', $phonenumber, $matches);
	}
	// Phonenumber with 4 digit area code
	if (preg_match('/([0]{1}[1-9]{1}[0-9]{2}[-\s]+[1-9]{1}[\s]*([0-9]{1}[\s]*){5})/', $phonenumber)) {
		preg_match('/(?<areacode>[0]{1}[1-9]{1}[0-9]{2})[-\s]+(?<localnumber>[1-9]{1}[\s]*([0-9]{1}[\s]*){5})/', $phonenumber, $matches);
	}
	// Phonenumber with 3 digit area code
	if (preg_match('/([0]{1}[1-9]{1}[0-9]{1}[-\s]+[1-9]{1}[\s]*([0-9]{1}[\s]*){6})/', $phonenumber)) {
		preg_match('/(?<areacode>[0]{1}[1-9]{1}[0-9]{1})[-\s]+(?<localnumber>[1-9]{1}[\s]*([0-9]{1}[\s]*){6})/', $phonenumber, $matches);
	}


	$areacode = $matches[areacode];
	$localnumber = preg_replace('/ /', '', $matches[localnumber]);
	$phonenumber = $areacode. '-'. $localnumber;

	// Add Country code if needed
	if ($field['phone_country_code']) {
    	$areacode = preg_replace('/^0/', '', $areacode);
		$phonenumber = '+31-'. $areacode. '-'. $localnumber;
    }

============================
My modified code:

$areacode = $localnumber = '';
	// Mobile number
	if (preg_match('/([0]{1}[6]{1}[-\s]+[1-9]{1}[\s]*([0-9]{1}[\s]*){7})/', $phonenumber)) {
		preg_match('/([0]{1}[6]{1})[-\s]+([1-9]{1}[\s]*([0-9]{1}[\s]*){7})/', $phonenumber, $matches);
	}
	// Phonenumber with 4 digit area code
	if (preg_match('/([0]{1}[1-9]{1}[0-9]{2}[-\s]+[1-9]{1}[\s]*([0-9]{1}[\s]*){5})/', $phonenumber)) {
		preg_match('/([0]{1}[1-9]{1}[0-9]{2})[-\s]+([1-9]{1}[\s]*([0-9]{1}[\s]*){5})/', $phonenumber, $matches);
	}
	// Phonenumber with 3 digit area code
	if (preg_match('/([0]{1}[1-9]{1}[0-9]{1}[-\s]+[1-9]{1}[\s]*([0-9]{1}[\s]*){6})/', $phonenumber)) {
		preg_match('/([0]{1}[1-9]{1}[0-9]{1})[-\s]+([1-9]{1}[\s]*([0-9]{1}[\s]*){6})/', $phonenumber, $matches);
	}

	$areacode = $matches[1];
	$localnumber = preg_replace('/ /', '', $matches[2]);
	$phonenumber = $areacode. '-'. $localnumber;

	// Add Country code if needed
	if ($field['phone_country_code']) {
    	$areacode = preg_replace('/^0/', '', $areacode);
		$phonenumber = '+31-'. $areacode. '-'. $localnumber;
    }

I have removed variables areacode and local number form the original code.
And access others using the array index

thierry_gd’s picture

Status: Active » Fixed

Taken into account in 6.2.18 release

Status: Fixed » Closed (fixed)

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