?
Referenced as Pull Request for: # 9541
avatar vistiyos
vistiyos
22 Mar 2016

Steps to reproduce the issue

Create a basic component (com_test) and then try to use Joomla autoloader using JLoader::registerPrefix('Test', JPATH_COMPONENT) method.

Create a class on the root of that folder called TestController and try to run that component.

Expected result

What I would expect is that Joomla finds automatically that class. Class name has two parts (Test and Controller), so it should find the class on a file called controller.php placed on the root of the component folder.

Actual result

Joomla tries to find the class on the next path com_test/controller/controller.php file, which is not there.

System information (as much as possible)

Joomla 3.5

Additional comments

If I understand right the way Joomla uses camel case classes is that it splits the name on parts and each part is a folder except from the last one. For example, ClassPart1Part2, if should be on the com_class/part1/part2.php.

If you think this is a bug too, I will provide some code to fix that issue, but I would like to know if someone else finds this a bug for the autoloader class.

avatar vistiyos vistiyos - open - 22 Mar 2016
avatar mbabker
mbabker - comment - 22 Mar 2016

It's a quirk with the autoloader, and one I'm not sure you can fix in a B/C manner. As you found, the path in the actual result is what is expected right now.

If you can address it in a B/C manner, code would surely be appreciated.

avatar brianteeman brianteeman - change - 22 Mar 2016
Labels Added: ?
avatar brianteeman
brianteeman - comment - 23 Mar 2016

Closed as we have a PR - thanks - see #9541

avatar brianteeman brianteeman - change - 23 Mar 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-03-23 10:39:36
Closed_By brianteeman
avatar brianteeman brianteeman - close - 23 Mar 2016

Add a Comment

Login with GitHub to post a comment