J3 Issue ?
avatar thaneshs
thaneshs
18 Jul 2018

I have upgraded site to latest Joomla3.8.10 successfully. But custom components are throwing blank page on Helper function call. componentNameHelperhelperName::functionName() method is not supporting i guess.

An error has occurred.
0 Class 'DirectoryHelpersDirectory' not found

I am getting a response (return value) from helper function, but page is blank. Is there any changes in helper or helper call on latest upgrade ?

avatar thaneshs thaneshs - open - 18 Jul 2018
avatar joomla-cms-bot joomla-cms-bot - change - 18 Jul 2018
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 18 Jul 2018
avatar mbabker
mbabker - comment - 18 Jul 2018

Component code isn't autoloaded. Without seeing your code, we can't diagnose your issue. As long as you are correctly loading your helper class it should be working.

avatar franz-wohlkoenig franz-wohlkoenig - change - 18 Jul 2018
Status New Discussion
avatar franz-wohlkoenig franz-wohlkoenig - change - 18 Jul 2018
Category Code style
avatar brianteeman brianteeman - change - 18 Jul 2018
Labels Added: J3 Issue
avatar brianteeman brianteeman - labeled - 18 Jul 2018
avatar thaneshs
thaneshs - comment - 19 Jul 2018

Hi Michael,

I found the root cause of this issue and fixed it now. This front end issue is due to declaring same class name in both front-end and admin component (same component). This was working fine in our previous version Joomla3.6.5.

PHP Fatal error: Cannot declare class DirectoryHelpersDirectory, because the name is already in use in /administrator/components/com_directory/helpers/directory.php on line 18

I think Joomla loads both admin and front end helper files on latest upgraded version. If yes, Will it affect performance of site loading with both admin and front-end helpers together ?

avatar mbabker
mbabker - comment - 19 Jul 2018

Joomla does not arbitrarily load any files out of a component. Again, without seeing some of your code, there isn't much that we can troubleshoot here to determine if it's an issue in the core code or your implementation.

Remember, none of the component extension code is mapped to an autoloader. For files to be loaded, they must follow convention. That generally covers the files used for MVC (controllers, models, tables, and views directories, as well as the base controller.php file), the component's router (router.php), the main component entry point file, and depending on what integrations you support potentially a helper for associations (helpers/associations.php) and categories (helpers/category.php). com_fields also has some code which can look for a component helper file (in your case helpers/directory.php) in the administrator component for certain tasks, but IIRC this is mostly related to save processes.

avatar Stevec4
Stevec4 - comment - 19 Jul 2018

This could be related to the b/c issue that was found in component creator when J3.7 was released.

https://www.component-creator.com/en/blog/80-joomla-3-7-backwards-compatibility-issue

avatar brianteeman brianteeman - change - 23 Jul 2018
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2018-07-23 18:35:07
Closed_By brianteeman
avatar brianteeman
brianteeman - comment - 23 Jul 2018

closed as not core joomla bug

avatar brianteeman brianteeman - close - 23 Jul 2018

Add a Comment

Login with GitHub to post a comment