Difference between revisions of "Missing JBrowser class after upgrading"
From Joomla! Documentation
m (layout) |
m (heading) |
||
(5 intermediate revisions by 2 users not shown) | |||
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. | 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. | ||
+ | ==Errors reported== | ||
<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 | ||
</pre> | </pre> | ||
− | == | + | == Versions affected == |
{{refers_to|3.1.4,3.1.5}} | {{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}} | + | {{notice|This issue only affects '''some''' 3rd party extensions in Joomla! versions 3.1.4 and higher|imagesize=25px}} |
== What is the cause== | == What is the cause== | ||
− | + | An instance of Joomla! Core using JBrowser has been removed causing it not to be automatically loaded on all pages. | |
== How to fix == | == How to fix == | ||
− | Change the source code | + | Change the source code to something similar as below. |
From this: | From this: |
Revision as of 20:17, 12 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.
Errors reported[edit]
Fatal error: Class 'JBrowser' not found in path/to/file.php on line XY
Versions affected[edit]
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();
//...