vsooe Posted February 5, 2019 Share Posted February 5, 2019 (edited) Hello, on WHMCS 6.3.2, legacy WHMCS 5 template Apache Version 2.4.37 PHP Version 5.6.38 in file /templates/default/viewinvoice.tpl is: Quote {if $allowchangegateway} <form method="post" action="{$smarty.server.PHP_SELF}?id={$invoiceid}">{$gatewaydropdown}</form> {else} but suddenly i found when i use this dropdown it does not switch payment methods. I already tried to: - enable debug mode - tried to restore stock invoice.tpl file and clear template cache - tried Chrome and Firefox (both same issue) Please kindly advice me what to check or try. Thank you in advance for the help. Edited February 5, 2019 by postcd 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 5, 2019 Share Posted February 5, 2019 when did you notice it first fail ? what happens when you try it with the "five" template rather than "default" ? 0 Quote Link to comment Share on other sites More sharing options...
vsooe Posted February 5, 2019 Author Share Posted February 5, 2019 (edited) I was notified today about this, but it could happen even a few weeks back. I tried to change template to "five" in Setup / General Settings / General and then cleaned Template cache. I see that not helped to make the dropdown menu to switch payment methods on the invoice page. Edited February 5, 2019 by postcd 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 5, 2019 Share Posted February 5, 2019 i'd be tempted to think it's a .js issue with the onchange="submit()" not triggering correctly.. i've just tried it on a v6.3.2 dev, using five or default and am not noticing any problem. any recent changes that could have caused this ? have you added a new payment gateway recently ? 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted February 5, 2019 Share Posted February 5, 2019 When you switch the payment method, it should do a submit to viewinvoice.php?id=<invoice_number> . Does that happen? Using firefox inspect or chrome's equal, watch the network traffic page for the request if you can't see it do a refresh. If the page does not reload, then check the browser console for javascript errors as something there is likely causing the issue. 0 Quote Link to comment Share on other sites More sharing options...
vsooe Posted February 5, 2019 Author Share Posted February 5, 2019 (edited) There is no reload, no action in the developer console (both Firefox and Chrome) on Network tab and on Console tab when i switch payment method on invoice page dropdown menu. I have not added new payment gateway recently. Should i anyhow disable some payment gateways? (preferably without loosing their data) I would also restore stock files of a directories which you tell me (maybe some in /includes/ ?), so we can see if it is files problem or hosting problem? Apparently it is not a problem of the template.. Edited February 5, 2019 by postcd 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted February 5, 2019 Share Posted February 5, 2019 And that same behavior of no reload happens on stock 5 template? Odd as that popup just does a javascript onchange and submits the form as if you hit a button. Look at the source of the invoice page and confirm the action set for the payment switch form is indeed set to the /viewinvoice and not like blank. 0 Quote Link to comment Share on other sites More sharing options...
vsooe Posted February 5, 2019 Author Share Posted February 5, 2019 (edited) Yes, the "five" also do not shows anything and no redirect on developer consoles of both browsers. Quote Look at the source of the invoice page and confirm the action set for the payment switch form is indeed set to the /viewinvoice and not like blank. I used stock invoice.tpl and so it should be all right, though i am unsure which file you mean so i can find that "action set". The error_log shows this: Trying to get property of non-object in /home1/me/public_html/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code on line 83 // dummy local smarty variable if (!isset($_template->tpl_vars['smarty'])) { ---< 83 line $_template->tpl_vars['smarty'] = new Smarty_Variable; Undefined index: custviewinvoicealtpay in /home1/postcd/public_html/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code on line 148 Undefined index: paymentsuccess in /home1/me/public_html/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code on line 170 Undefined index: pendingreview in /home1/me/public_html/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code on line 173 Undefined index: paymentfailed in /home1/me/public_html/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code on line 176 Undefined index: manualapplycredit in /home1/me/public_html/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code on line 184 Trying to get property of non-object in /home1/me/public_html/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code on line 184 Last modification time of the smarty_internal_templatebase.php is 2016 Edited February 5, 2019 by postcd 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted February 5, 2019 Share Posted February 5, 2019 I meant the source of the invoice page when looking at it an invoice in your browser. Look at the source for the page and find the form for switching. The action should be set to /viewinvoice and if you do not see action, then that is the issue. Don't have a copy of the stock template, so what is at line 184 in the viewinvoice.tpl file? 0 Quote Link to comment Share on other sites More sharing options...
vsooe Posted February 5, 2019 Author Share Posted February 5, 2019 > source of the invoice page when looking at it an invoice in your browser <font class="unpaid">Unpaid</font><br /> <form method="post" action="/viewinvoice.php?id=10331"><input type="hidden" name="token" value="stringhere" /><select name="gateway" onchange="if (!window.__cfRLUnblockHandlers) return false; submit()" class="form-control select-inline" data-cf-modified-stringhere-=""><option value="coinpayments" selected="selected"> > what is at line 184 in the viewinvoice.tpl file? /templates/default/viewinvoice.tpl {foreach from=$transactions item=transaction} <tr> <td class="textcenter">{$transaction.date}</td> <---- 184 line <td class="textcenter">{$transaction.gateway}</td> <td class="textcenter">{$transaction.transid}</td> <td class="textcenter">{$transaction.amount}</td> </tr> {foreachelse} 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted February 5, 2019 Share Posted February 5, 2019 Are you using Cloudflare? Looks like they added "if (!window.__cfRLUnblockHandlers) return false; and I wonder if that is failing in some way to prevent the submit from happening. 1 Quote Link to comment Share on other sites More sharing options...
vsooe Posted February 5, 2019 Author Share Posted February 5, 2019 @steven99 thank You very much for your help. When i paused Cloudflare protection on their website, the payment method switching started working. (One may need to purge cache on cloudflare site and maybe also in WHMCS / Utilities / System / System Cleanup / clear template cache) I will submit ticket to Cloudflare to ask them what exact setting may be causing this.. 0 Quote Link to comment Share on other sites More sharing options...
vsooe Posted February 20, 2019 Author Share Posted February 20, 2019 (edited) Hello, the fix/workaround of this issue is to disable Cloudflare Performance measures on invoice page.https://support.cloudflare.com/hc/en-us/articles/200169526-I-get-a-site-offline-error-message-when-updating-or-accessing-the-admin-section-of-my-content-management-system Page rule should be for: *yourdomainhere.com/viewinvoice.php* And only rule to apply is Performance: Disable -- i can not edit my leading post. if anyone can, you can mention it in it Edited February 20, 2019 by postcd 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.