In a multilingual environment "List All Categories" returns a possibly wrong articles count
For other reasons I prepared a multilingual set-up that can be used to test this. It is a simple but exhaustive set-up:
In front-end visit the menu items for "List All Categories": you will see something like this:
As you can see all articles in each category are accounted for.
Now visit (click on) one of the three categories.
Only 2 articles will be displayed: the one associated to the current language and the one associated to "All" languages.
Thus, the count of articles in "Articles » List All Categories" is wrong (it doesn't "filter out" the unwanted language)
The issue is due to the model for "List categories" using JCategories::get() which doesn't have provision for filtering items based on language
Fixing this will also have the beneficial side effect of possibly hiding categories containing only articles non-relevant for the current language (if "Empty Categories: Hide" is set).
What do you think?
N.B.: I'm personally unwilling to put my inexperienced hands on JCategories::get()'s queries and I'll need assistance for that, but I'm more then willing to help in any other possible way
I don't see a TOATAL articles count in blog layout, but, yes, 2 articles are listed for each category
... and hiding the count does not solve the issue that categories with no visible articles will be anyway listed.
At a first cursory look I think the language constrain should be introduced in jCategories::_load() in the subquery used to count items ('countItems' option), more or less as it is done for the 'published' option.
Can this be done as a condition in the ON
clause?
@smanzi You got me wrong, anyways, if you debug with your ide layouts/joomla/content/categories_default.php [this is the list view], you will see that you have the language for every item. So all it needs to be done to get this the way you want it is to have some case logic for the available languages. Hope it helps
Thanks!
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-12-13 11:18:53 |
Labels |
Added:
?
|
This is also the case if instead of list you choose blog layout?