J3.x

Difference between revisions of "Missing JBrowser class after upgrading"

From Joomla! Documentation

m (→‎Afected versions: spelling and comma)
m (layout)
Line 1: Line 1:
{{notice|This issue only affects '''some''' 3rd party extensions in Joomla! versions 3.1.4 and higher}}
+
After update to Joomla 3.1.4 or later, some some extensions that depend on the native autoloader, with a working code before, may stop working.
  
== Typical error message ==
 
 
<pre>
 
<pre>
 
Fatal error: Class 'JBrowser' not found in path/to/file.php on line XY
 
Fatal error: Class 'JBrowser' not found in path/to/file.php on line XY
Line 7: Line 6:
  
 
== Affected versions ==
 
== Affected versions ==
After update to Joomla 3.1.4, some some extensions that depend on the native autoloader, with a working code before, may stop working.
+
{{refers_to|3.1.4,3.1.5}}
 +
{{notice|This issue only affects '''some''' 3rd party extensions in Joomla! versions 3.1.4 and higher}}
 +
 
 +
== What is the cause==
 +
This is not resolved.
  
== Workaround ==
+
== How to fix ==
While this is not resolved, change the source code from something similar to this
+
Change the source code from something similar to this:-
  
 +
From this:
 
<source lang="php">
 
<source lang="php">
 
$browser = JBrowser::getInstance();
 
$browser = JBrowser::getInstance();
Line 17: Line 21:
 
</source>
 
</source>
  
To this (with legacy way to load classes)
+
To this (with legacy way to load classes):
 
<source lang="php">
 
<source lang="php">
 
JLoader::import('joomla.environment.browser') // Add this linecode
 
JLoader::import('joomla.environment.browser') // Add this linecode
Line 26: Line 30:
 
[[Category:Version 3.1.4 FAQ]]
 
[[Category:Version 3.1.4 FAQ]]
 
[[Category:Version 3.1.5 FAQ]]
 
[[Category:Version 3.1.5 FAQ]]
[[Category:Version 3.1 FAQ]]
 

Revision as of 19:39, 11 August 2013

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

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

Affected versions[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]

This is not resolved.

How to fix[edit]

Change the source code from something similar to this:-

From this:

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

To this (with legacy way to load classes):

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