Jump to content

WHMCS 8.0.4 on other than default english language - issue with domain pricing and currency


Recommended Posts

Hello,

I've upgraded yesterday from latest 7.x LTS version to 8.0.4 and I'm facing some issues with domain pricing checking where index.php?rp=/domain/check for

   
 
token	"sometoken"
a	"checkDomain"
domain	"somedomain.tld"
type	"domain"

 

is returning:

result	[ {…} ]
0	Object { sld: "somedomain", idnSld: "somedomain", status: "unknown", … }
domainName	""
idnDomainName	""
tld	""
tldNoDots	""
sld	"webio3"
idnSld	"somedomain"
status	"unknown"
legacyStatus	"error"
score	1
isRegistered	false
isAvailable	false
isValidDomain	false
...

but interesting that for second request:

token	"sometoken"
a	"checkDomain"
domain	"somedomain.tld"
type	"spotlight"

(so we have only difference in type domain->spotlight) WHMCS is returning:

result	[ {…}, {…}, {…}, {…}, {…} ]
0	Object { domainName: "somedomain.tld", idnDomainName: "somedomain.tld", tld: "tld", … }
domainName	"somedomain.tld"
idnDomainName	"somedomain.tld"
tld	"tld"
tldNoDots	"tld"
sld	"somedomain"
idnSld	"somedomain"
status	"available for registration"
legacyStatus	"available"
score	1
isRegistered	false
isAvailable	true
isValidDomain	true
domainErrorMessage	""
pricing	[]
shortestPeriod	[]
group	""
minLength	0
maxLength	0
isPremium	false
premiumCostPricing	[]

so as you can see it detects correctly domain TLD but for some unknown for me reason pricing JSON array is empty which obviously is causing JS error.

I've also encountered few errors in viewing cart:


Oops!
Something went wrong and we couldn't process your request.

Please go back to the previous page and try again.

Error: Invalid TLD/Registration Period Supplied for Domain Registration

which after googling pointed me to some currency issues (I have only one currency and one not default language - non english - in WHMCS).

Does someone experienced similar issues on your end?

Thanks

Edited by webio
Link to comment
Share on other sites

2 hours ago, webio said:

Does someone experienced similar issues on your end?

is your cart.php redirecting to a .html page? if so, what happens when you disable that redirection and just use the cart as intended?? ideally using Six and SC to ensure that it isn't a custom template issue.

Link to comment
Share on other sites

cart is redirected yes BUT this is not a problem IMHO because how do you explain that one POST request is somehow returning some data:

token	"sometoken"
a	"checkDomain"
domain	"somedomain.tld"
type	"spotlight"

but second one

 

token	"sometoken"
a	"checkDomain"
domain	"somedomain.tld"
type	"domain"

is not. Also spotlight, suggestions and domain searching is not a new function in WHMCS 8. This was working just fine in WHMCS 7.x. I don't see any breaking changes in release notes for WHMCS 8 which is telling anything about some kind of request verification URL referrer especially that all request contain token generated by WHMCS. If a referer would be really a problem here then this could cause issues to users which are blocking tracking for their web browsers web browsing.

Please take under consideration that POST requests are being made TO:

index.php?rp=/domain/check

which is not being rewritten in any way.

Link to comment
Share on other sites

assuming i'm looking at the correct site, i'm seeing "Domains must begin with a letter or a number and be between 0 and 0 characters in length" after any search (not in English) - spotlight prices are showing... same error occurs on Six & SC, hence why I said to go back to basics and lose the redirection.

Link to comment
Share on other sites

Spotlight prices are beign shown because I've hacked scripts.js file to check if pricing JS array is empty and skip the line which uses it when it is empty.

For spotlight pricing prices are already there if you check website code:

<span class="available price hidden">SOME PRICE HERE WITH CURRENCY/span>

It looks like spotlight JS query is overwriting this span element after successful JS POST query. Feel free to check browser dev tools network traffic to see whats going on. 

Error "Domains must begin with a letter or a number and be between 0 and 0 characters in length" is being returned for first JS POST request and I have totally no idea why it is happening because IMHO request is being made correctly, with all fields, I've checked also this on default templates using WHMCSURL/?systpl=six and WHMCSURL/?carttpl=standard_cart, tested also on all hooks removed from /includes/hooks dir. I will try to disable rewrites today (I'm running WHMCS on Windows Server IIS but c'mon this can't be server related) and try again.

EDIT: I've made test also with completely removed rewrite/redirect section from IIS  and WHMCS set to Basic URLs, switched to six and standard_cart templates (all requests where using .php files in URL) and problem was the same. The same JSON result are being returned by WHMCS.

EDIT2: Also for first request there is also error in system activity log:

WHOIS Lookup Error for '': extension not listed in /resources/domains/dist.whois.json or /resources/domains/whois.json

This is related to first request JSON returning:

result	[ {…} ]
0	Object { sld: "somedomain", idnSld: "somedomain", status: "unknown", … }
domainName	""
idnDomainName	""
tld	""
tldNoDots	""
sld	"somedomain"
idnSld	"somedomain"
status	"unknown"
legacyStatus	"error"
score	1
isRegistered	false
isAvailable	false
isValidDomain	false
...

because as you can see even when request is using params:

token	"sometoken"
a	"checkDomain"
domain	"somedomain.tld"
type	"domain"

we have proper domain in domain field WHMCS is returning JSON with:

tld	""
tldNoDots	""
sld	"somedomain"
idnSld	"somedomain"

so TLD is being somehow dropped somewhere.

Edited by webio
Link to comment
Share on other sites

I've moved a little further. Take a look what WHMCS is passing as param to registrar module

function REGISTRARMODULENAME_CheckAvailability($params)
{

function. I've simply added print_r($params) to this function at the begging. function content was returned to JSON returned to browser POST request. Take a look below. There is something for sure wrong going on in WHMCS because data which is being passed to POST request contain proper domain name but WHMCS is striping it and only passing first part of domain to registrar module

Array
(
    [whmcsVersion] => 8.0.4-release.1
    [ErrorsLang] => PL
    [Password] => .....
    [TestMode] => 
    [Username] => ....
    [sld] => webio3
    [tlds] => Array
        (
            [0] => 
        )

    [searchTerm] => somedomain
    [tldsToInclude] => Array
        (
            [0] => 
        )

    [isIdnDomain] => 
    [punyCodeSearchTerm] => 
    [premiumEnabled] => 
    [original] => Array
        (
            [ErrorsLang] => PL
            [Password] => .....
            [TestMode] => 
            [Username] => ....
            [sld] => somedomain
            [tlds] => Array
                (
                    [0] => 
                )

            [searchTerm] => somedomain
            [tldsToInclude] => Array
                (
                    [0] => 
                )

            [isIdnDomain] => 
            [punyCodeSearchTerm] => 
            [premiumEnabled] => 
        )

)

 

Edited by webio
Link to comment
Share on other sites

Problem has been resolved by WHMCS support and issue was tblcurrencies having one entry with ID = 2 (but set to "1" in default column) - it looks like some WHMCS code rely on ID = 1 from tblcurrencies.  Currency was something which I've changed at the beginning of using/configuring WHMCS which I was doing 10 years ago and it worked without any issues until upgrade to 8.x. So for anyone having WHMCS for a long time now this might pop out after upgrade.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated