?
Related to # 4729
avatar phproberto
phproberto
21 Aug 2014

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

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
1.00

avatar phproberto phproberto - open - 21 Aug 2014
avatar vdespa vdespa - change - 13 Sep 2014
Category Libraries
avatar vdespa vdespa - change - 13 Sep 2014
Status New Confirmed
avatar nicksavov
nicksavov - comment - 15 Oct 2014

Good catch, Roberto! Looks like it's still an issue.

avatar zero-24 zero-24 - close - 17 Oct 2014
avatar jissues-bot jissues-bot - close - 17 Oct 2014
avatar brianteeman brianteeman - change - 17 Oct 2014
Status Confirmed Closed
Rel_Number 4729
Relation Type Related to
avatar brianteeman
brianteeman - comment - 17 Oct 2014

Please see #4729 for a solution

avatar jissues-bot
jissues-bot - comment - 17 Oct 2014
avatar jissues-bot jissues-bot - change - 17 Oct 2014
Closed_Date 0000-00-00 00:00:00 2014-10-17 08:05:53
avatar zero-24 zero-24 - change - 7 Jul 2015
Labels Added: ?

Add a Comment

Login with GitHub to post a comment