Jump to content
thirty bees forum

Mobile_detect problem


Recommended Posts

I am busy making my webshop fit for PHP 8.1 and Thirty Bees 1.5.1.

Now when I run the shop in this new constellation I get an error 'Class "Mobile_Detect" not found' for my Whatsappchat module.

The offending line is "$mobile = new Mobile_Detect();"

It looks like this is a Thirty Bees problem. In the TB 1.4 version I see in /classes/Context.php "new Mobile_Detect();". In 1.5.1 this is "new MobileDetect();". So something was changed.

However, making a similar change in my Whatsappchat module doesn't solve my problem. I still get a class not found error.

Does anyone know the solution?

Link to comment
Share on other sites

Yes, this library introduced backwards incompatible changes.

Version 2.8 used Mobile_Detect in global namespace. Since version 3.x, the classname was moved to \Detection\MobileDetect

Old version 2.8 do not work on php7.1 and newer, so we had to update it


You have to fix the module code that depends on old version of library.

In fact, you should rewrite the module to use Context::getDevice / Context::isMobile / Context::isTablet 


  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...