J3.x

Missing JBrowser class after upgrading

From Joomla! Documentation

(Redirected from J3.x:Missing jbrowser class after upgrading to joomla 3.1.4)

After update to Joomla 3.1.4 or later, some extensions that depend on the native autoloader, with a working code before, may stop working.

Errors reported[edit]

Fatal error: Class 'JBrowser' not found in path/to/file.php on line XY

Versions affected[edit]

Info non-talk.png
General Information

This pertains only to Joomla! version(s):- 3.1.4  3.1.5

Info non-talk.png
General Information

This issue only affects some 3rd party extensions in Joomla! versions 3.1.4 and higher

What is the cause[edit]

An instance of Joomla! Core using JBrowser has been removed causing it not to be automatically loaded on all pages.

How to fix[edit]

Change the source code to something similar as below.

From this:

$browser = JBrowser::getInstance();
//...

To this (with legacy way to load classes):

JLoader::import('joomla.environment.browser') // Add this linecode
$browser = JBrowser::getInstance();
//...