Jump to content

WHMCS 7 breaks addons templates


Eduardo G.

Recommended Posts

Hi!

 

I use several custom addons and whmcs 7 has broken them all.

Each addon has its own templates, using smarty.

But now, when I render a template, I get:

 

Error: Fatal error: Uncaught --> Smarty: Unable to load template file 'my_template.tpl'

 

It happens with any simple template, so I see no specific tags causing problemas.

I've also tried Smarty Security Policy's bypass, using:

 

$smarty_security_policy => array(
   'system' => array(
       'trusted_dir' => array(
           '/path/to/my/addon',
           '/path/to/my/addon/templates',
       ),
   ),
);

 

But still same error.

 

Can't find the source of the error and can't get any help from whmcs support.

Can someone else help me?

 

Thanks.

Link to comment
Share on other sites

I just checked this one myself, and cannot replicate this.

In your addon module, make sure you have

       'templatefile' => 'my_template',

 

In addition, make sure that you have my_template.tpl in the addon directory (not in your template directory).

if you're storing this as addon/templates/my_template.tpl, change

       'templatefile' => 'my_template',

to

       'templatefile' => 'templates/my_template',

 

the template path will always be relative to the addon itself.

 

If you didn't design the addon, you'll want to talk to the developer of the addon, as it's likely encoded

Link to comment
Share on other sites

Thanks, twhiting9275

Addons are already working on version 6.x, so all paths are ok

Problem comes with version 7, so I don't think the code is the problem.

Must be something "global", like security policy or similar.

Sure it's related with whmcs's smarty integration, but can't guest how :-(

 

Any other idea?

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