User tests: Successful: Unsuccessful:
Pull Request for Issue #46614
Fixes an issue where expired articles were displayed in frontend category views.
Frontend category listings did not apply publish date constraints, allowing
expired articles to appear and affect article counts.
Enforced publish date filtering when retrieving articles in the category model.
Fixes #46614
| Status | New | ⇒ | Pending |
| Category | ⇒ | Front End com_content |
| Title |
|
||||||
I have tested this item 🔴 unsuccessfully on a9f8d81
I applied the patch to my site using the Yootheme template.

I created a category with three articles.
One is expired; it's displayed in the category overview as green with "1" as published, which is incorrect.


The others are red and disabled.
They don't count.
With this setting.
1 item expired.
You'll see this message on a basic template.
With Yootheme, this is counted as 1 item.
And it shouldn't be.
An expired item shouldn't be counted.

It appears that an article in an expired category is still counted as a published article.
An expired article is still published. The state of an article does not change when the publish date is either in the future or in the past
An expired article is still published. The state of an article does not change when the publish date is either in the future or in the past
@brianteeman Does that mean that this PR is wrong, and the referenced issue #46614 should have been closed as expected behavior?
From my perspective yes but thats just my opinion
From my perspective yes but thats just my opinion
@brianteeman From my perspective, too. But the issue was labeled as but by @chmst .
If you use core joomla content and test a blog category layout then it correctly counts the number of visible (puublished and current) articles. I have never used anything from yootheme and nor will I ever use anything from yootheme but if yootheme is not counting correctly then its because they are not counting correctly
Thanks for the replies.
Yootheme correctly says, see the link in the first message in the ticket there, that it's in Joomla.
https://yootheme.com/support/question/172237#answer-561640
Yootheme's ticket also refers to this closed pull #40172
It's also strange that an expired article is counted.
But as I understand it from the replies, this is 'normal' Joomla behavior.
How does Joomla check this and calculate that there are no articles in Cassiopea?
It indicates that there are no articles if there is one expired article.
Is this handled in Cassiopea's own code?
No it is nothing to do with cassiopeia it is in the model for the content component which clearly yootheme ignores. yootheme is NOT just a template it does its own thing regarding selecting content and clearly it is wrong/incomplete!!
joomla-cms/components/com_content/src/Model/ArticlesModel.php
Lines 512 to 526 in 4e34a7e
@brianteeman Thanks for the response, I will pass this on in the ticket at Yootheme
I installed a plain vanilla Joomla 6.0.2, installed sample content, created a parent category, moved the sample content categories into that. Then I set the "Finish Publishing" date of 2 of the "Blog" category's articles to a date in the past (but left them at Status: Published), set 1 of the 4 articles to Status: Unpublished.
With "Cassiopeia" a "Category List" menu item for the parent category, set to # Articles in Category: Show displays the count 3 in the public frontend.
Then I installed YOOtheme Pro, used Dynamic Content, and mapped a field to the "Blog" category's "Article Count". In the preview and in a private/incognito window the count was also 3.
As far as I can see the count is fully consistent regardless of the template, and — in my test — the very same "3" in Cassiopeia and in YOOtheme Pro.
At the same time, the native count of 3 seems wrong to me because a public user in the frontend gets the information that there are 3 articles but will never see those that are past their "Finish Publishing" date. Technically, it might be accurate that there are 3 articles with the status "Published".
The count is a different issue and not expired articles appearing in frontend category view
But it's precisely the counting that matters.
Because an expired item is counted, the feature doesn't work in Yootheme.
Yootheme then sees one item listed even though it's expired and no longer visible to one user.
The counting is the problem.
@brianteeman The count is a different issue and not expired articles appearing in frontend category view
This is here is absolutely and entirely about the count, the output of the option # Articles in Categoryin the frontend.
It is not about whether or not articles appears in the frontend.
Without testing it, you wrote that YOOtheme Pro displays the wrong count. I tested it and could not confirm it. The number is the same in Cassiopeia and YOOtheme Pro.
Related Pull Request for the display of the count #44950
This is about the articles that are inaccessible.
So that's correct for that request.
But what I mean is just public articles.
But then one has expired, and that one is still counted.
And the request you're referring to is for Joomla 6.
And I'm still running 5.4.
the confusion is from your previous statements
The articles in the backend are counted correctly, for example, 2 published and 2 unpublished.
In the frontend, 4 are counted, which is incorrect.
and a lack of clarity that this was referring to the count displayed in a category list view
For core joomla it can be worked around by chosing not to display the article count in the front end list view
However that will not help you in yootheme as from your screenshots (i've never use yootheme nor will i ever) the count is being used as a condition in the admin. As far as I am concerned the correct fix for yootheme is to update the yootheme code so that it correctly takes into account the publish_up/down fields in the same way that the core of joomla already does when counting the articles in the blog category view (as i have shared previously)
@brianteeman The code you quoted here (#46637 (comment)) has nothing todo with the category item count, but instead it filters the articles that are shown. The wrong article count can be replicated on the Category Blog layout in Joomla core.
That being said, I don't think this PR fixes the item count issue. As you pointed out, this would have to be fixed in a similar fashion as #44950.
But again, the issue has nothing to do with YOOtheme Pro and can be replicated in Joomla core.
I can not replicate this in a category blog. Maybe I am missing something?
With Cassiopeia as theme.
Steps to reproduce the issue:
# Articles in Category to showIf you go to that menu item in the frontend it will show the Article Count of 2 for the subcategory. If you then go to that subcategory, you'll see 1 article.
ah - that;s the same count as seen in the list view. My point was that the DISPLAY of articles was correct it is just the DISPLAY of the count that is incorrect and I stand 100% behind my previous comments
Hi all,
I’ve opened a new PR that fixes the category article count issue by excluding
expired articles (respecting publish_up / publish_down dates).
The issue has been tested on Joomla 5.4 with the Cassiopeia template and
category menu item showing article counts.
Please let me know if a review is needed or if any adjustments are required.
Thanks!


@RudraHingu001 When creating a pull request please stick with our pull request template, which suggests the reference to the issue to be in the first line (I have just fixed that for youz) and which provides headings for testing instructions and for checkboxes if documentation is required or not.