cluster Posted February 16, 2018 Share Posted February 16, 2018 my phone number issue is back, if I submit a domain registration via registrar module it cuts of the country code numbers, in database and order emails it shows the complete phone number but it does not work for the API anymore ... f.ex. +33 9999999 is now formated as +9999999 2 days ago I have syncronized the URLs and added the code into the .htaccess, here is my current phone number formating, the + symbol keeps in place only the number of the country code is missing now. 'phonenumber' => "+".str_replace('.','',$params["phonenumber"]), Link to comment Share on other sites More sharing options...
cluster Posted February 16, 2018 Author Share Posted February 16, 2018 (edited) some more details ... after changing / save a client phone number from the admin area the client log shows: Client Profile Modified - Phone Number: '9999999' to '+33.9999999' (doesent matter how many time it's been saved, it shows only the local number in the log afterwards) but it's not changed, if I submit the order to the registar or hosting panel it is saved as 9999999 w/o any country code It seems the syncing of URL friendly (index.php only, same as before) disabled phone number formating for outgoing API requests Edited February 16, 2018 by cluster Link to comment Share on other sites More sharing options...
WHMCS ChrisD Posted February 17, 2018 Share Posted February 17, 2018 Hey @cluster Which version of WHMCS are you using and which Registrar? Do you have Phone Number formatting enabled under Setup > General Settings > Localisation? Link to comment Share on other sites More sharing options...
cluster Posted February 18, 2018 Author Share Posted February 18, 2018 Hi Chris, - WHMCS 7.4.2 - Registrar: EuroDNS - Phone Number formatting is enabled because of a JS search functionissue in transaction user field I have syncronised the SEO URLs (index.php only) and inserted the displayed code in the htaccess rewrite base is disabled because a subfolder installation of whmcs. the complete phone number is shown in order emails but the country code is missing in user logs (when changing) of whmcs and outgoing requests to the registrar API. Client Profile Modified - Phone Number: '9999999' to '+33.9999999' is shown also after a 2nd click "save" client profile ### BEGIN - WHMCS managed rules - DO NOT EDIT BETWEEN WHMCS MARKERS ### <IfModule mod_rewrite.c> RewriteEngine on # RewriteBase is set to "/" so rules do not need updating if the # installation directory is relocated. It is imperative that # there is also a RewriteCond rule later that can effectively get # the actual value by comparison against the request URI. # # If there are _any_ other RewriteBase directives in this file, # the last entry will take precedence! #RewriteBase / # Redirect directories to an address with slash RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^(.+[^/])$ $1/ [R] # Send all remaining (routable paths) through index.php RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # Determine and use the actual base RewriteCond $0#%{REQUEST_URI} ([^#]*)#(.*)\1$ RewriteRule ^.*$ %2index.php [QSA,L] </IfModule> ### END - WHMCS managed rules - DO NOT EDIT BETWEEN WHMCS MARKERS ### Link to comment Share on other sites More sharing options...
cluster Posted February 19, 2018 Author Share Posted February 19, 2018 It took me a whole week to edit all my customers for the new phone number feature ... It worked for about one month and after the URL syncing for the JS fix (client search in transactions), now the country code number is ignored ... I can not add another week to change all the phone numbers again. So I need a solution! Link to comment Share on other sites More sharing options...
cluster Posted February 19, 2018 Author Share Posted February 19, 2018 it acts as if the function int. phone number formating has been disabled, but it is enabled ... the country code is also missing after a new hosting package was created from whmcs to a server, the client profile shows only the local phone number w/o country code. Link to comment Share on other sites More sharing options...
cluster Posted February 23, 2018 Author Share Posted February 23, 2018 it seems i am using a contolpanel module which contains its own composer version ... could the problem be caused by an interaction with composer, or is that a BUG in whmcs? I have previously tested on another whmcs version and there is synonymous when changing the client profile (phonenumber) only the landline without country prefix displayed in the log Link to comment Share on other sites More sharing options...
cluster Posted February 23, 2018 Author Share Posted February 23, 2018 to reproduce ... edit a client profile (phone number) change only the landline number e.g. +1 12345 to +1 123456 Save check the client log tab there you see changed from 12345 to +1 123456 then just save it again it shows ... changed from 12345 to +1 123456 then send a domain registration to a sandbox API in the API log you only see the landline +12345 as phonenumber instead of +1 123456 Link to comment Share on other sites More sharing options...
WHMCS ChrisD Posted February 25, 2018 Share Posted February 25, 2018 Hey @cluster Thanks for your reply, I'm just replicating this can you tell me under Setup > General Settings > Localisation tab > Phone Numbers checkbox is that checked or unchecked Link to comment Share on other sites More sharing options...
cluster Posted February 25, 2018 Author Share Posted February 25, 2018 yes it's checked, it worked for about 2 weeks, after the friendly URL syncing the problem has started ... the database entrys are fine it shows the complete phone number. the problems is that $_POST did not submit the country code dropdown field when saving the profile form or create a server and register a domain name, the country code field is ignored Phone Numbers Tick to enable international phone number input interface and automatic formatting Link to comment Share on other sites More sharing options...
cluster Posted March 4, 2018 Author Share Posted March 4, 2018 if I turn it off (Phone Number formatting) are the country codes removed from the database user phone numbers right after? Link to comment Share on other sites More sharing options...
brian! Posted March 4, 2018 Share Posted March 4, 2018 30 minutes ago, cluster said: if I turn it off (Phone Number formatting) are the country codes removed from the database user phone numbers right after? no... but if you then enter a number again, the format entered will be preserved. the feature should be disabled for you anyway... I can't see the point in enabling it, and then complaining that it's changing the formatting of the entered value - that's what it does! Link to comment Share on other sites More sharing options...
cluster Posted March 4, 2018 Author Share Posted March 4, 2018 yeah. I guess that would be the best solution would it be possible to keep it only for the frontend by editing the checkout.tpl? Link to comment Share on other sites More sharing options...
brian! Posted March 5, 2018 Share Posted March 5, 2018 22 hours ago, cluster said: would it be possible to keep it only for the frontend by editing the checkout.tpl? I doubt you could do it purely by editing the template, possibly with a hook to enable it on the checkout stage only... <?php /** * Enable Phone Number Interface @ Checkout * @author brian! */ function cart_phone_interface_hook($vars) { if ($vars['templatefile']=='viewcart'){ return array("phoneNumberInputStyle" => "1"); } } add_hook("ClientAreaPageCart", 1, "cart_phone_interface_hook"); number entered at checkout... and stored in the database... so it's adding the country code, removing the leading 0 and not removing spaces. personally, this is like being pregnant - either you are or you're not... either you use the phone number feature or you don't.... partially enabling it just at checkout could be asking for trouble.... Link to comment Share on other sites More sharing options...
cluster Posted March 5, 2018 Author Share Posted March 5, 2018 haha, yes you are probably right ;-) thanks a lot for your help and the hook, that's great! Link to comment Share on other sites More sharing options...
cluster Posted March 5, 2018 Author Share Posted March 5, 2018 that works very well, great work! Link to comment Share on other sites More sharing options...
Recommended Posts