? Success
Referenced as Related to: # 4140

User tests: Successful: Unsuccessful:

avatar thongredweb
thongredweb
17 Oct 2014

This PR is for issue #4140

Original Report

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

avatar thongredweb thongredweb - open - 17 Oct 2014
avatar jissues-bot jissues-bot - change - 17 Oct 2014
Labels Added: ?
avatar brianteeman brianteeman - change - 17 Oct 2014
Category Libraries
avatar brianteeman brianteeman - change - 17 Oct 2014
The description was changed
avatar jissues-bot jissues-bot - change - 17 Oct 2014
Title
[fix #4140] JModelLegacy::addIncludePath is supposed to support arrays
JModelLegacy::addIncludePath is supposed to support arrays
avatar brianteeman brianteeman - change - 17 Oct 2014
Title
[fix #4140] JModelLegacy::addIncludePath is supposed to support arrays
JModelLegacy::addIncludePath is supposed to support arrays
avatar ahmet---gul
ahmet---gul - comment - 21 Aug 2015

First , I paste the example code which is written by you to getItems method in category.php . Then in frontend , I clicked the article category list and got the error .

screen shot 2015-08-21 at 04 21 56

After that I tried your code via patch tester .When I cliked the article category list , I didn't get the error . It worked !

screen shot 2015-08-21 at 04 23 58


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/4729.

avatar ahmet---gul ahmet---gul - test_item - 21 Aug 2015 - Tested successfully
avatar tflm84
tflm84 - comment - 21 Aug 2015

works!


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/4729.

avatar tflm84 tflm84 - test_item - 21 Aug 2015 - Tested successfully
avatar roland-d roland-d - change - 21 Aug 2015
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2015-08-21 13:17:31
Closed_By roland-d
avatar roland-d roland-d - close - 21 Aug 2015
avatar roland-d roland-d - reference | 6a00dc5 - 21 Aug 15
avatar roland-d roland-d - merge - 21 Aug 2015
avatar roland-d roland-d - close - 21 Aug 2015
avatar zero-24 zero-24 - change - 21 Aug 2015
Milestone Added:

Add a Comment

Login with GitHub to post a comment