Jump to content

setLocalTranslator ERROR in WHMCS v8.0.0.r1


jcn50

Recommended Posts

Hi Guys,

I had this error after the upgrade to WHMCS v8.0.0.r1:

[29-Sep-2020 09:54:12 UTC] [WHMCS Application] ERROR: TypeError: Argument 1 passed to Carbon\CarbonInterval::setLocalTranslator() must implement interface Symfony\Component\Translation\TranslatorInterface, instance of Carbon\Translator given, called in /public_html/vendor/nesbot/carbon/src/Carbon/Traits/Difference.php on line 778 and defined in /public_html/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php:168 Stack trace: #0 /public_html/vendor/nesbot/carbon/src/Carbon/Traits/Difference.php(778): Carbon\CarbonInterval->setLocalTranslator(Object(Carbon\Translator)) #1 /public_html/modules/widgets/Support.php(46): Carbon\Carbon->diffForHumans() #2 /public_html/vendor/whmcs/whmcs-foundation/lib/Module/AbstractWidget.php(0): WHMCS\Module\Widget\Support->generateOutput(Array)

I had to comment out lines [777-779] of this file:

/vendor/nesbot/carbon/src/Carbon/Traits/Difference.php

for the admin to work!

Link to comment
Share on other sites

1 minute ago, jcn50 said:

Upgrading to v8.0.1.r1 did not change anything 😞

I was just about to suggest doing that. 🙂

ideally for an issue like this, you should have posted in the v8 forums as that will be more likely to be seen, and responded to, by WHMCS staff...

opening a ticket with Support would be another option - they may be aware whether this is a known bug or not.....

it's possible that the initial v8 upgrade didn't complete correctly and there are missing files - and an incremental patch update, or maybe even the automatic updter, might not be able to fix.

getting hold of the v8.0.1 full zip and reuploading the vendor folder from it might be worth a go to see if that fixes it.

Link to comment
Share on other sites

On 10/5/2020 at 2:00 PM, brian! said:

ideally for an issue like this, you should have posted in the v8 forums as that will be more likely to be seen, and responded to, by WHMCS staff...

Oh sorry, I was not sure were to post~ if you want or if a mod comes around: this thread can be moved.

 

14 hours ago, PV-Patrick said:

I am experiencing the same issue, did you get it work?

I had to comment out the lines of that PHP script (see my previous post). That error is only triggered when logging in as an admin. I am not sure if it is linked with the theme/template that I have.

 

On 10/5/2020 at 2:00 PM, brian! said:

it's possible that the initial v8 upgrade didn't complete correctly and there are missing files - and an incremental patch update, or maybe even the automatic updter, might not be able to fix.

The error does not suggest that, it seems to be a variable type mistake in the code (see below).

 

On 10/5/2020 at 2:00 PM, brian! said:

getting hold of the v8.0.1 full zip and reuploading the vendor folder from it might be worth a go to see if that fixes it.

I have just done this and it didn't work~ so I think it is a real bug.

 

=> Finally I have upgraded to version 8.0.2.r1 and it's the same. I have decided to email directly Brian Nesbitt whom seem to be the code maintainer of that script. I will revert here if I hear from him.

Link to comment
Share on other sites

I have updated composer and added nesbot:

composer require nesbot/carbon

However now I am getting this error, meh:

PHP Fatal error:  Uncaught Error: Class 'WHMCS\Utility\ErrorManagement' not found in init.php:0

But the file ErrorManagement.php file exists in /vendor/whmcs/whmcs-foundation/lib/Utility/ and all the files are correctly 8.0.2.r1...

Edited by jcn50
Link to comment
Share on other sites

I had something else that needed an upgrade: I had a POP3 cron set-up in the parent directory (../whmcsdata/crons/) and those scripts were not upgraded at all. You might want to double check those scripts when upgrading to v8!

Link to comment
Share on other sites

On 10/7/2020 at 5:30 AM, jcn50 said:

OK, I have manually re-uploaded v8.0.2r1 ZIP (minus the install folder) and it is working again WITHOUT that initial error! (yay). 

I hope this helps someone~

Thank you so much @jcn50 for the help!  I'll give this a try tonight and see if it works.  I also have a support ticket in with WHMCS but not sure how helpful that will be.

Link to comment
Share on other sites

@jcn50 @agarzon Received this reply from WHMCS support and it worked for me.

During the update to WHMCS 8 a number of files are deleted from the installation. However, if these fail due to permission issues certain files left over could cause issues. This particular issue you experienced appears to be caused by the following file not being able to be deleted:

/vendor/symfony/translation/TranslatorInterface.php

Therefore if you experience the issue after upgrade removing that file should solve the problem.

Link to comment
Share on other sites

10 hours ago, PV-Patrick said:

@jcn50 @agarzon Received this reply from WHMCS support and it worked for me.

During the update to WHMCS 8 a number of files are deleted from the installation. However, if these fail due to permission issues certain files left over could cause issues. This particular issue you experienced appears to be caused by the following file not being able to be deleted:


/vendor/symfony/translation/TranslatorInterface.php

Therefore if you experience the issue after upgrade removing that file should solve the problem.

I had to reinstall from scrath everything again and import sql backup. Was the only way to fix it after trying all kind of solutions including to reupload all the files from the whmcs_v802_full.zip

Link to comment
Share on other sites

  • 2 years later...

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