?
avatar bassmanpaul
bassmanpaul
23 Oct 2014

The administrator category list view filters by extension, which allows 3rd party extensions to use the #__categories database table.

However the article list view does not filter by extension type. This means that 3rd party extensions using the #__content database table for their content items appear in Joomla's article list.

The fix I propose copies the exact filtering code used in the com_categories\models\categories.php model. Although I did notice that the categories model didn't filter the #__associations query in getListQuery(); by extension so I have also left this out when copying the logic across to the articles model.

I spent about an hour trying to create a pull request on GitHub but failed miserably! I'd be happy to provide my proposed fix but can't upload PHP files to trackers!

If anyone wants to help me create a pull request on Github I'd appreciate that, otherwise I can email the file or detail the changes that I made (3 small changes) in greater detail on this tracker.

avatar bassmanpaul bassmanpaul - open - 23 Oct 2014
avatar Bakual
Bakual - comment - 23 Oct 2014

However the article list view does not filter by extension type. This means that 3rd party extensions using the #__content database table for their content items appear in Joomla's article list.

The #__content table isn't meant to be used by 3rd party extensions. It's the table for com_content. Some extension use it to extend the function of com_content, but then it's perfectly fine that the items inserted by those extensions also appear in the article manager.

If you don't want that, then create your own tables.

Closing as expected behavior.

avatar Bakual Bakual - close - 23 Oct 2014
avatar zero-24 zero-24 - close - 23 Oct 2014
avatar Bakual Bakual - change - 23 Oct 2014
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-10-23 10:11:31
avatar bassmanpaul
bassmanpaul - comment - 23 Oct 2014

Hi Bakual,

Thanks for your reply. The articles model always joins onto the category table and so implies that you can filter by extension. Furthermore the Front-End does actually filter by extension, which again implies that this is expected behaviour (please see: line 245 in components/com_content/models/articles.php) so surely the Back-End should follow suit.

Regards,

Paul

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

avatar sovainfo
sovainfo - comment - 23 Oct 2014

Could you post the changes you are suggesting?

avatar Bakual
Bakual - comment - 23 Oct 2014

There is a doc page which explains how to create a PR using the GitHub UI: http://docs.joomla.org/Using_the_Github_UI_to_Make_Pull_Requests

If you know Git, you can also create a branch in your local clone of your Joomla fork, do your changes there and then create a PR from that.

I still think you should not try to use the articles model to fetch your own items. It's not meant to do that. You should instead extend from JModelList and do your own stuff.

avatar bassmanpaul
bassmanpaul - comment - 23 Oct 2014

Hi Sovainfo & Bakual,

Thanks for the tutorial, that was way more helpful than GitHub's version. I have managed to make a pull request here:

#4903

As Previously mentioned the code is virtually an exact copy of the categories.php model file. It's not the 3rd party extension fetching the model data that is the problem. The issue is that 3rd party content items are stored in the database an displayed in Joomla's article manager view. So it's Joomla's view that would be fixed in this scenario.

(The article model is versatile enough to not even need extending because you can set the filters in the user state before calling Joomla's model).

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

avatar zero-24 zero-24 - change - 7 Jul 2015
Labels Added: ?

Add a Comment

Login with GitHub to post a comment