Difference between revisions of "Missing JBrowser class after upgrading"
From Joomla! Documentation
m (→Afected versions: spelling and comma) |
m (layout) |
||
Line 1: | Line 1: | ||
− | + | 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. | |
− | |||
<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 == | ||
− | + | {{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. | ||
− | == | + | == How to fix == |
− | + | 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]] | ||
− |
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]
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();
//...