webio Posted November 19, 2020 Share Posted November 19, 2020 (edited) 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 November 19, 2020 by webio 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 19, 2020 Share Posted November 19, 2020 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. 0 Quote Link to comment Share on other sites More sharing options...
webio Posted November 19, 2020 Author Share Posted November 19, 2020 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. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 19, 2020 Share Posted November 19, 2020 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. 0 Quote Link to comment Share on other sites More sharing options...
webio Posted November 19, 2020 Author Share Posted November 19, 2020 (edited) 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 November 19, 2020 by webio 0 Quote Link to comment Share on other sites More sharing options...
webio Posted November 19, 2020 Author Share Posted November 19, 2020 (edited) 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 November 19, 2020 by webio 0 Quote Link to comment Share on other sites More sharing options...
webio Posted November 19, 2020 Author Share Posted November 19, 2020 HA! I've found something. This issue is not occurring when user is logged in or impersonated. This MUST be WHMCS issue. 0 Quote Link to comment Share on other sites More sharing options...
webio Posted November 26, 2020 Author Share Posted November 26, 2020 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. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.