Jump to content

Update WHMCS from 8.13.1 to 9.0 Critical Error --> Smarty: undefined extension class 'Smarty_Internal_Method_Get_Template_Vars' <--


Go to solution Solved by Mytihost,

Recommended Posts

My live WHMCS installation automatically updated to 9.0 and the site went down with a Critical Error: Luckily I have site monitoring on so I was notified by email immediately!

Quote

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

Please go back to the previous page and try again. If the problem persists, please contact us.

« Back to Homepage

For additional assistance, please reference the WHMCS TroubleShooting Guide »

--> Smarty: undefined extension class 'Smarty_Internal_Method_Get_Template_Vars' <--

I rolled back to ver 8.13.1 using a softaculous backup/restore, and set up a dev site to troubleshoot. I worked with ChatGPT to find the files causing this. 

  • I use the Lagom 2 Client Theme and Website Theme, and
  • ResellerClub-Mods addon modules, including the Core Management Console ver. 4.  --> The hooks in this module include older Smarty hooks
  • PHP 8.2.29 + ionCube 15.0.0 are the currently acceptable versions.
  • Smarty also updated to Smarty is v4.5.3 which is needed for the new 9.0version. 

We did a backtrace and found:

Quote

/modules/addons/resellerclubmods_core/hooks.php

That addon is calling a legacy Smarty method (almost certainly get_template_vars()), which dies under Smarty 4 in WHMCS 9, producing your exact error.

So the fix is not Lagom, not WHMCS core, not Smarty itself. It’s that ResellerClub Mods addon.

I disabled the resellerclubmods_core/hooks.php by adding an _ at the end. The dev site was restored but that means I can't sell my products!

I have a ticket in to ResellerClub-Mods to udpate their core management console ver 4, as the update from 1/9/26 doesn't address the issue. 

To set up my dev site, I had WHMCS reissue my dev license, and I will need RS Studios to reissued my Lagom 2 theme dev license as I have made changes since it was issued. I can't see if the theme is correct after the update without a fresh dev license. 

In the meantime, my live site keeps automatically updating to 9.0 and I have to keep rolling it back! WHMCS hasn't provided a way to turn off the auto updates that works (changing the temp update file path location doesn't work if the file path isn't valid, and turning off Update WHMCS in Admin Roles doesn't work either - it just takes that option off the board.) Ugh. 

Has anyone else run into this problem? I just wanted to put this out there in case someone else is having this problem. I will update with any working solution when I have it. It's already been 4 days, so I'm hoping it happens soon. 

Link to comment
Share on other sites

Whmcs doesn’t autoupdate - someone is initiating the update.

You’re using addons that are not compatible- yet. Logos is not compatible 

Roll back and stay there till all your addons declare compatibility with v9.

Edited by slim
Link to comment
Share on other sites

  • Solution

You may want to check in softaculous you may have the auto update turned on.

Go into Softaculous find your install click on edit details auto upgrade select do not auto upgrade.

 

With regards to 9.0 their will still be a lot of developers slightly behind. WHMCS didn't exactly give developers alot of notice with regards to the changes.

Link to comment
Share on other sites

@Rayyan What error are you getting after disabling/renaming the hooks file? What else is wrong?

As for my site, I turned off updates in Softaculous - Thank you @Mytihostand @RadWebHosting - That was the problem with the auto updating. I won't update until the RC-Mods core management is updated for WHMCS ver9.  And even then, I'm updating in a staging site first to make sure it all works first. 

 

Link to comment
Share on other sites

If the addon itself is still active you'll still get the error regardless off what you rename the file.

The addon itself will be trying to load that main hook file.

If its the updated addon thats causing that issue do you not have the version below to roll it back

 

 

Link to comment
Share on other sites

  • 3 months later...
Posted (edited)

Hello people,

I had this exact problem as well, it was caused by Resellerclub mods but I found the fix. 

You need to update the module/registrars folder as well as /modules/addons/resellerclubmods_core

These files are available here: https://www.resellerclub-mods.com/whmcs/login

From here download logicboxes_registrars_3.19.0_PHP_7.4_8.4.zip and resellerclubmods_core_1.9.0_PHP_7.4_8.4.zip

Then upload it to your installation of WHMCS and you should be good to go!

Thanks
Dave Geoghegan
https://www.webworld.host

Edited by davegeoghegan
Link to comment
Share on other sites

Hi @davegeoghegan   First, always backup (I use Softaculous) so you can easily restore when there is a problem like this last major update to ver 9.0. What a lifesaver! I turned on all the log errors and debug options in WHMCS and used ChatGPT to help me find the root of the update problem. For me it was ResellerClub-Mods addon & core modules and my custom theme.

To successfully update to ver. 9.0 I had to wait for updated addon modules and theme template files.  So keep the existing (older) WHMCS installation in tact until everything is updated to work together. (don't update yet).  You will need to disable the auto-update in WHMCS. You can't turn it off really, so I call it disabling. 

Go to Utilities->Update WHMCS -> Configure Update Settings and select the option " Current Version - Restricts to maintenance updates for the currently installed version (#.#)".  Note the temp path for the staging files in that window (/whmcs-backups). You can't just delete this info or give it a fake name as the system won't allow it. You will need to go to your hosting File Manager or use FTP to change the name of this folder so WHMCS doesn't automatically write the staging files to it -> something like /whmcs-backups_   will work.

Once you have updated versions of the addon modules/theme templates/etc, you should test it all in a staging environment if you can. 

Before updating, deactivate the RC modules in WHMCS/Addon Modules (follow their updating instructions for this one, you might have to delete the modules in  /modules/addons), delete the RC-Mods files in the /includes/hooks file (cPanel), then run the WHMCS update to ver 9. Once done, update/re-install the RC-Mods (and custom themes) and check that it all works together. 

I've tried to remember everything I did to update successfully. If you still have trouble, post again and let's see if we can get you up to date. 🙂

Link to comment
Share on other sites

@davegeoghegan 

Did you copy the WHMCS 9.0 vendor folder files over the existing 8.13.1 vendor folder?

The proper way is to delete the old vendor folder completely and then upload the fresh vendor folder from WHMCS 9.0. If you are still getting this error even after doing that, it will require a more careful examination.

Link to comment
Share on other sites

I'm using the smarty folder from  version 8.13.1 

I think the problem is that the class Smarty_Internal_Method_GetVariable was removed in Smarty 4, which is why we're getting that error. 

Something is still using that, probably a third-party plugins, themes or modules.

I deleted the /templates folder and uploaded that again from the latest version, that didn't work so it's not that anyway. 

The error mesage is very vague so its difficult to troubleshoot. 

Thanks
Dave Geoghegan
https://www.webworld.host

Link to comment
Share on other sites

Please post the error message(s) as verbose as possible. Along with the error logging and debugging options in WHMCS, you can also check in your cPanel File Manager in your WHMCS installation for a PHP error file, or in cPanel Errors to view what might be happening. As for the /vendor/smarty folder, I believe it has to be from the 8.13 version and not ver 9.0 of WHMCS as they did get rid of the Smarty files and hooks in ver 9. They need to continue working with the out-dated modules/addons that aren't working with ver. 9.

What other modules and addons are you using that might not be updated to work with ver 9.0 and interfering with the new version of WHMCS? For me it was ResellerClub-Mods and my Lagom Theme files. 

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