Hi, I'm not sure if this is expected behaviour or not but I have 2 extensions that have their own namespaced HTML classes, but because the file names are the same they conflict due to the HTMLHelper
only looking at a single stack of static include paths.
For example:
JHTML::addIncludePath( 'components/com_one/html/' );
HTMLHelper::_( 'onehtml.framework.core' ); // class: OneHtmlFramework->core();
JHTML::addIncludePath( 'components/com_two/html/' );
HTMLHelper::_( 'twohtml.framework.core' ); // class: TwoHtmlFramework->core();
But because they both have a framework.php
file the HTMLHelper
matches the first path it finds in the includes array which for one of the extensions will throw an exception (src/HTML/HTMLHelper.php
line ~129).
What the helper does is:
framework.php
in it.$path = \JPath::find(static::$includePaths, strtolower($file) . '.php');
if (!$path)
{
throw new \InvalidArgumentException(sprintf('%s %s not found.', $prefix, $file), 500);
}
\JLoader::register($className, $path);
if (!class_exists($className))
{
throw new \InvalidArgumentException(sprintf('%s not found.', $className), 500);
}
Should it not loop through the available paths until it finds a path match and a class match, then throw an exception after failing to find one?
Labels |
Added:
?
|
Labels |
Added:
No Code Attached Yet
bug
Removed: ? |