Function declaration states that you can pass an array of paths to the addIncludePath
:
/**
* Add a directory where JModelLegacy should search for models. You may
* either pass a string or an array of directories.
*
* @param mixed $path A path or array[sting] of paths to search.
* @param string $prefix A prefix for models.
*
* @return array An array with directory elements. If prefix is equal to '', all directories are returned.
*
* @since 12.2
*/
https://github.com/joomla/joomla-cms/blob/staging/libraries/legacy/model/legacy.php#L76
But that's false. If you try to use it like:
JModelLegacy::addIncludePath(
array(
JPATH_ADMINISTRATOR . '/components/com_content/models',
JPATH_SITE . '/components/com_content/models'
)
);
You will get a nice error caused because JPath expects to receive a string:
https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/filesystem/path.php#L199
And we are passing it the array:
https://github.com/joomla/joomla-cms/blob/staging/libraries/legacy/model/legacy.php#L108
Not time to dig into it. I just wanted to report it before forgetting it
Category | ⇒ | Libraries |
Status | New | ⇒ | Confirmed |
Status | Confirmed | ⇒ | Closed |
Rel_Number | ⇒ | 4729 | |
Relation Type | ⇒ | Related to |
Set to "closed" on behalf of @brianteeman by The JTracker Application at issues.joomla.org/joomla-cms/4140
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-10-17 08:05:53 |
Labels |
Added:
?
|
Good catch, Roberto! Looks like it's still an issue.