Jump to content
actionhosting

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

Recommended Posts

Hello

 

I am having an issue in the client area, when users select a smartermail service, they get Something went wrong and we couldn't process your request. with this info

Error: Call to a member function getTemplateVars() on null in /var/www/vhosts/billing.wsigenesis.com/whmcsdata/templates_c/6168120062068525cbc19f8fd94a9d6e8c6ab6ae_0.file.clientarea.tpl.php:25
Stack trace:

0 /var/www/vhosts/billing.wsigenesis.com/httpdocs/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_5ff3743078b550_78353019()
1 /var/www/vhosts/billing.wsigenesis.com/httpdocs/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode()
2 /var/www/vhosts/billing.wsigenesis.com/httpdocs/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(216): Smarty_Template_Compiled->render()
3 /var/www/vhosts/billing.wsigenesis.com/httpdocs/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(232): Smarty_Internal_Template->render()
4 /var/www/vhosts/billing.wsigenesis.com/httpdocs/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(116): Smarty_Internal_TemplateBase->_execute()
5 /var/www/vhosts/billing.wsigenesis.com/httpdocs/vendor/whmcs/whmcs-foundation/lib/Smarty.php(0): Smarty_Internal_TemplateBase->fetch()
6 /var/www/vhosts/billing.wsigenesis.com/httpdocs/vendor/whmcs/whmcs-foundation/lib/ClientArea.php(0): WHMCS\Smarty->fetch()
7 /var/www/vhosts/billing.wsigenesis.com/httpdocs/clientarea.php(0): WHMCS\ClientArea->getSingleTPLOutput()

WHMCS advise:::

 

I have discovered a solution: you can allow the template object in Smarty Security policy as mentioned here:

https://docs.whmcs.com/Smarty_Security_Policy#Supported_Policy_Settings_and_Values

Here is an example of a working policy and template snippet using the $template object instead of getTemplateVars() that demonstrates this

// minimum policy inside configuration.php
$smarty_security_policy = array(
    'system' => array(
        'disabled_tags' => [],
        'enabled_special_smarty_vars' => array(
            'template_object',
        ),
    ),
);

<!-- in the page's template -->
{php}
    echo 'PHP Block: ';
    echo $template->tpl_vars['template'];
    echo "<br/>";
{/php}
Template Variable: {$template}<br/>

I trust that gives you a good starting point for your customisations.

Does any one know where to add the above

 

Thanks

 

Brian

 

Share this post


Link to post
Share on other sites
On 06/01/2021 at 16:53, actionhosting said:

Does any one know where to add the above

it would go in the existing configuration.php file in the root of your WHMCS install...

Share this post


Link to post
Share on other sites

Hello 

For me it was the smartermail server add on  modules/servers/smartermail/smartermail.php  edit this file and locate all lines with getTemplateVars() and comment it out as they do not work anyways since the smartermail code is very dated and there has not been any update for years.

Doing this while the smartermail function will not work, but this is ok, at least the whmcs functions and it will eliminate the errors.

 

Brian

 

 

Share this post


Link to post
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.


  • Similar Content

    • By Web Host Pro
      I use the quick bar a lot and it unfortunately disappears when I'm on the support ticket page or account activation page. SO I have to click my home page logo to get back to it. Is it possible to have that available on all pages? Or maybe I'm missing something in  the navigating when viewing a ticket to get back to: tickets waiting
      I have version 8.1.1
      Also a little thing with the WHMCS admin on my IPhone S. It squishes the form content and spreads out the username in the ticket list. It's the third attached image.
      8.1.1 is working really great!
      Thanks!
       

       

       

       
    • By wsa
      WHMCS Services would like to wish love to all our customers for Valentine's Day!!! We want to show our love by giving you the gift of 35% off all of our Source Code Version products and 20% off all licensed versions. Simply use 'valentinesc20' in the coupon code and receive 35% off and for the Licensed version, use 'valentine20' in the coupon code   How Long Will this Sale Last? This Valentine Special will last until February 15th, 2021   To take advantage of the sale simply add a WS Modules to your shopping cart.   Here is a list of our various modules products: Click Here   Save even more!   Hurry! The sale ends on February 15th, 2021!   Do You Need Custom Development For Your Business? Click Here   Looking for help with WHMCS? We also provide WHMCS Themes, WHMCS installation, WHMCS configuration & WHMCS integration services.   If you have any questions about our services, please chat with us at http://www.whmcsservices.com or contact us at sales (at) whmcsservices.com   Thanks again for choosing WHMCS Services. We appreciate your business   Our Social Media: Twitter Here Facebooks Here Instagram Here
    • By Corner
      Hello all,
      I need to create a feature on my WHMCS website.
      It's a Additional Required Information (WHMCS domain name) on my configure product page, when someone enter the domain name on that field I have to verify , that domain name have valid WHMCS license, otherwise they can't be able to add my product on cart. So how I can verify WHMCS license on my website.
      I know there is a verification method on WHMCS website https://www.whmcs.com/members/verifydomain.php  , but how I have this on my website.
      Anyone do this type of job, please let me know.
      Thanks 


    • By actionhosting
      Hello All,
      I have a situation, where if a client by any means has credits and uses this credit to pay for an order.  It can be many years later, if the client terminates this order and the order is cancel. WHMCS will automatically refund the client the payment on the very first invoice. As I have a number of clients that funds their account and this fund appears as credits and is used to pay for new orders and or outstanding invoices. My issue is when this order is cancel the first invoice is refunded.
      NOTE: cancel order not cancel & refund.
      Now whmcs advised only to terminate the order and leave it in the system, the issue is some client wants their data deleted and hence the order must be deleted and hence the issue.
      Now if the order was paid by credit card and is terminated and deleted - this issue does not happen. It only happens if a) one fund their account b) order a new service and pay for it using the credit - as you can see clients that is aware of this issue can abuse it.
      As in many cases I have to delete the order, if you know of a way that can prevent a deleted order from automatically and there are 2 cancel buttons, I would expect cancel to not issue any refunds, while cancel and refund button will issue refunds.
       
      Thanks
       
      Brian
       
       
    • By actionhosting
      Hello All,
      As whmcs removed the toolbar from v8, and thanks to Brian's hook I am able to adjust it and add back overdue invoices to just the admin home page. In the image attached, you will see it above the panel badges (by default the 4 whmcs provided badges).  I am able to adjust the css to add a 5th panel badge as the image will show.
      Question does any knows how I can hook into the panel badges, as whmcs support does not have an answer.  All I want to do is a) from the image remove Brian's modified hook, and hook into the panel badge as display total overdue invoices.
      Thanks in advance.
      Brian
       

  • 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