Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class 'JToolBarHelper' not found #14330

Closed
PhocaCz opened this issue Mar 4, 2017 · 2 comments

Comments

Projects
None yet
3 participants
@PhocaCz
Copy link

commented Mar 4, 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

@mbabker

This comment has been minimized.

Copy link
Member

commented Mar 4, 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.

@mbabker mbabker closed this Mar 4, 2017

@PhocaCz

This comment has been minimized.

Copy link
Author

commented Mar 4, 2017

Ok, thank you for the info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.