?
avatar PhocaCz
PhocaCz
4 Mar 2017

Steps to reproduce the issue

Install some extension, in my case it was Phoca Photo. After installing it and going to the extension I get this error:
Class 'JToolBarHelper' not found

Expected result

JToolbar classes will be automatically loaded

Actual result

JToolbar classes are not automatically loaded, they must be individually loaded, e.g. by:

if(!class_exists('JToolbar')) {
   require_once JPATH_SITE . '/libraries/cms/toolbar/toolbar.php';
}
if(!class_exists('JToolbarHelper')) {
   require_once JPATH_SITE . '/libraries/cms/toolbar/helper.php';
}

System information (as much as possible)

Joomla! 4, PHP 7, MySQL 5

avatar PhocaCz PhocaCz - open - 4 Mar 2017
avatar joomla-cms-bot joomla-cms-bot - change - 4 Mar 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 4 Mar 2017
avatar mbabker
mbabker - comment - 4 Mar 2017

The class' correct cased name is JToolbarHelper, not JToolBarHelper, and has been such since 3.0.0 (same applies to all JToolbar* classes). The casing is important with our autoloader because it will split the class name based on CamelCasing if it needs to try and load a file that hasn't yet been loaded.

JToolBarHelper will try to find a file at libraries/(cms|joomla|legacy)/tool/bar/helper.php whereas JToolbarHelper will use libraries/(cms|joomla|legacy)/toolbar/helper.php.

Closing as a non-issue.

avatar mbabker mbabker - change - 4 Mar 2017
Status New Closed
Closed_Date 0000-00-00 00:00:00 2017-03-04 17:00:11
Closed_By mbabker
avatar mbabker mbabker - close - 4 Mar 2017
avatar PhocaCz
PhocaCz - comment - 4 Mar 2017

Ok, thank you for the info.

Add a Comment

Login with GitHub to post a comment