msaunders Posted July 16, 2016 Share Posted July 16, 2016 Hey folks Hope you can help. Designed a new theme for V6 and currently working on a dev install of WHMCS (6.3) I have the new site template integrated with the V6 theme. I noticed when I browse to a page on the site and then click on a menu item from the whmcs client area , it is referencing the website path in the url for example http://www.domain.com/web-hosting/clientarea.php?action=services which of course wont work So I put this at the top of the page which I assume should resolve the issue {if $systemurl}<base href="{$systemurl}" />{/if} But when I refresh the page it goes into some sort of loop and just hangs and some of the page wont load. Any ideas why/what i might have done wrong ? Looks like its trying to pull in some code it cant find so the page is just hanging/timing out eventually . Thanks Martin 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted July 16, 2016 Share Posted July 16, 2016 I think there is no relation between the Base URL and loop, maybe something else is causing this! 0 Quote Link to comment Share on other sites More sharing options...
msaunders Posted July 16, 2016 Author Share Posted July 16, 2016 it seems to hang when it hits this entry in the head.tpl <script src="{$BASE_PATH_JS}/jquery.min.js"></script> 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 16, 2016 Share Posted July 16, 2016 perhaps try putting it in navbar.tpl instead ?? I did something similar in the thread about nested pages and it was the quickest solution I could think of to make the navbar use the correct urls.. ... or a jquery clash ? 0 Quote Link to comment Share on other sites More sharing options...
msaunders Posted July 16, 2016 Author Share Posted July 16, 2016 Hi Brian Sorry try putting what in the navbar.tpl ? I dont think its a jquery clash because this only happens when I insert the code to define the system URL , without it the site loads perfectly (apart from the menu items issue) Thanks! 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 16, 2016 Share Posted July 16, 2016 Sorry try putting what in the navbar.tpl ? lol - sorry, I meant the <base href line - and not necessarily with an {if} statement - just a normal <base href http://forum.whmcs.com/showthread.php?110983-Create-new-nested-page-OR-page-in-sub-folder&p=455782#post455782 0 Quote Link to comment Share on other sites More sharing options...
msaunders Posted July 16, 2016 Author Share Posted July 16, 2016 Sorry you mean add <base href="{$systemurl}"> to the navbar.tpl ... just tried it and same results - - - Updated - - - sorry Brian we posted at the same time there , yes tried it , same results unfortunately . Does this need anything configured in General Settings to work correctly ? I just have the WHMCS System URL entered in General Settings. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 16, 2016 Share Posted July 16, 2016 Does this need anything configured in General Settings to work correctly ? I just have the WHMCS System URL entered in General Settings. if that setting is correct, then it should be enough... though, of course, without knowing what you've modified in the template, it's hard to say for certain. if in navbar.tpl, you add - <base href="http://www.google.com"> (and I mean google, not your domain!), is it changing the menu link URLs... you won't need to click (wouldn't work anyway!), it should show in the browser footer - I just want to see if it's accepting the base value. 0 Quote Link to comment Share on other sites More sharing options...
msaunders Posted July 16, 2016 Author Share Posted July 16, 2016 Hi Brian Yes if I add that , it changes all my URLs to reference Google e.g <base href="http://www.google.com"> <li menuItemName="Home" id="Primary_Navbar-Home"> <a href="clientarea.php"> Home </a> </li> <li menuItemName="Services" class="dropdown" id="Primary_Navbar-Services"> <a class="dropdown-toggle" data-toggle="dropdown" href="#"> Services <b class="caret"></b> </a> <ul class="dropdown-menu"> <li menuItemName="My Services" id="Primary_Navbar-Services-My_Services"> <a href="clientarea.php?action=services"> My Services </a> </li> <li menuItemName="Services Divider" class="nav-divider" id="Primary_Navbar-Services-Services_Divider"> <a href=""> ----- </a> </li> <li menuItemName="Order New Services" id="Primary_Navbar-Services-Order_New_Services"> <a href="cart.php"> Order New Services </a> </li> <li menuItemName="View Available Addons" id="Primary_Navbar-Services-View_Available_Addons"> <a href="cart.php?gid=addons"> View Available Addons </a> </li> </ul> 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 16, 2016 Share Posted July 16, 2016 good! so what happens if you add your own WHMCS URL in the base href instead? (I mean hard-coded, not a smarty variable) surely it would make the links work correctly ?? 0 Quote Link to comment Share on other sites More sharing options...
msaunders Posted July 16, 2016 Author Share Posted July 16, 2016 ugh the site still hangs ........... 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 16, 2016 Share Posted July 16, 2016 I don't suppose there's anything in the activity log that could give you a clue ? 0 Quote Link to comment Share on other sites More sharing options...
msaunders Posted July 16, 2016 Author Share Posted July 16, 2016 i wonder is this some SSL thing ? When I enter the base url as https://mydomain and visit a page as http , the site loads fine and the links all work fine etc but if I click on a link its of course referencing https and then the site partially loads and hangs again ......? - - - Updated - - - I don't suppose there's anything in the activity log that could give you a clue ? Good idea but no , nothing . 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 16, 2016 Share Posted July 16, 2016 I was wondering about SSL too... in your general settings do you have both https and http in there ? 0 Quote Link to comment Share on other sites More sharing options...
msaunders Posted July 16, 2016 Author Share Posted July 16, 2016 No I just have http set . im sure i tried setting both but didnt make a diff. The dev url im testing this on doesn't have a valid SSL (its self signed) but that shouldn't make a difference i dont think. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 16, 2016 Share Posted July 16, 2016 with regards to the log, I suppose you do have Display Errors enabled in the general settings -> other it feels like it might be an http/s issue... you could try uploading it to your live site and using http://www.livedomain.com/index.php?systpl=*name of custom cart* to access it and see if it happens there too. 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted July 16, 2016 Share Posted July 16, 2016 Do you have any value in General Settings -> System SSL URL? Do you have .htaccess file in WHMCS main directory with Force SSL redirection? 0 Quote Link to comment Share on other sites More sharing options...
msaunders Posted July 16, 2016 Author Share Posted July 16, 2016 with regards to the log, I suppose you do have Display Errors enabled in the general settings -> other it feels like it might be an http/s issue... you could try uploading it to your live site and using http://www.livedomain.com/index.php?systpl=*name of custom cart* to access it and see if it happens there too. Yeah I enabled errors but its not showing me anything relating to this , that i can see anyway. - - - Updated - - - Do you have any value in General Settings -> System SSL URL? Do you have .htaccess file in WHMCS main directory with Force SSL redirection? No dont have any value in System SSL URL its blank. Dont have anything in the htaccess relating to redirection either.. thanks for the suggestions tho. 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted July 16, 2016 Share Posted July 16, 2016 it's always happen when you have SSL URL in System SSL URL with htaccess redirection cause infinite redirection loop. then check if SSL was set-up properly maybe, try to disable it completely! or you can set the System URL as: https://www.domain.com and see how things work? 0 Quote Link to comment Share on other sites More sharing options...
msaunders Posted July 16, 2016 Author Share Posted July 16, 2016 Ok ill check again . I wonder has it something to do with my index.php setup for each page ? example if I visit http://www.mydevdomain.com and am logged in as a customer (have the whmcs nav etc on screen) the homepage of the site loads fine but if I click into one of the sub pages like http://www.mydevdomain.com/personal-hosting/ the site hangs ...... <?php use WHMCS\Database\Capsule; define("CLIENTAREA", true); //define("FORCESSL", true); // Uncomment to force the page to use https:// require("../init.php"); $ca = new WHMCS_ClientArea(); $ca->setPageTitle("personalhosting"); $ca->addToBreadCrumb('index.php', Lang::trans('globalsystemname')); $ca->addToBreadCrumb('mypage.php', 'Your Custom Page Name'); $ca->initPage(); //$ca->requireLogin(); // Uncomment this line to require a login to access this page # To assign variables to the template system use the following syntax. # These can then be referenced using {$variablename} in the template. $ca->assign('variablename', $value); # Check login status if ($ca->isLoggedIn()) { # User is logged in - put any code you like here # Here's an example to get the currently logged in clients first name $clientName = Capsule::table('tblclients') ->where('id', '=', $ca->getUserID())->pluck('firstname'); $ca->assign('clientname', $clientName); } else { # User is not logged in } # Define the template filename to be used without the .tpl extension $ca->setTemplate('personalhosting'); $ca->output(); 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted July 16, 2016 Share Posted July 16, 2016 if this page http://www.mydevdomain.com/personal-hosting/ has Force SSL option enabled it will redirect only if there is value in System SSL URL 0 Quote Link to comment Share on other sites More sharing options...
msaunders Posted July 16, 2016 Author Share Posted July 16, 2016 I have it narrowed down to pages containing this code in my template <ul class="tab-nav clearfix"> <li><a href="#tabs-1">Monthly</a></li> <li><a href="#tabs-2">1 Year</a></li> <li><a href="#tabs-3">2 Year</a></li> </ul> Which basically renders a different set of divs depending on which tab u click on , If i remove this code, the page loads fine ... So this ahref is causing the page to crash if I have {if $systemurl}<base href="{$systemurl}" />{/if} in my header. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 16, 2016 Share Posted July 16, 2016 so perhaps it's linked to whmcs.js in footer.tpl ? and maybe the value of $WEB_ROOT can be replaced with a full URL?? <script src="{$WEB_ROOT}/templates/{$template}/js/whmcs.js"></script> 0 Quote Link to comment Share on other sites More sharing options...
msaunders Posted July 16, 2016 Author Share Posted July 16, 2016 error in console Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/. 0 Quote Link to comment Share on other sites More sharing options...
msaunders Posted July 16, 2016 Author Share Posted July 16, 2016 so perhaps it's linked to whmcs.js in footer.tpl ? and maybe the value of $WEB_ROOT can be replaced with a full URL?? <script src="{$WEB_ROOT}/templates/{$template}/js/whmcs.js"></script> Its something to do with jquery - if i comment out the call to the jquery file, the page loads but i lose some functionality . head.tpl <script src="{$BASE_PATH_JS}/jquery.min.js"></script> uuuugh!!! 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.