PR-6.2-dev Pending

User tests: Successful: Unsuccessful:

avatar hiteshm0
hiteshm0
23 Jun 2026

Pull Request resolves #47976

  • I read the Generative AI policy and my contribution is either not created with the help of AI or is compatible with the policy and GNU/GPL 2 or later.

Summary of Changes

This PR fixes an issue where categories containing exclusively future-published items (or items with an expired publish_down date) are incorrectly counted as having active items, causing them to be improperly displayed in frontend category lists and modules

[Edit] Scope of the PR was improved to include a fix wherein the heading 'Subcategories' was displayed category blogs/list modules even if there was no valid subcategory to display.

Implementation:

  1. Added a new check_dates opt-in parameter to the core Joomla\CMS\Categories\Categories::_load() method. When enabled, the item-counting subquery strictly enforces publish_up and publish_down window conditions.
  2. Enabled $options['check_dates'] = true; in the Category service constructors for com_content, com_contact, com_banners, and com_newsfeeds, as these core components actively utilize scheduled publishing dates.

Testing Instructions

  1. Create a Parent category and its child category.
  2. Create one more articles that belong to child category but have their publishing date somewhere in the future.
  3. Create a menu item of type 'Category Blog' or 'Category List' for the Parent category.
  4. Go into the Parent Categories blog/list.

Actual result BEFORE applying this Pull Request

The category with the not yet published articles is displayed in the subcategories list
image
image

Expected result AFTER applying this Pull Request

The category with the not yet published articles is not displayed in the subcategories list and the heading subcategories is not present either.
image

Link to documentations

Please select:

  • Documentation link for guide.joomla.org:

  • No documentation changes for guide.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar hiteshm0 hiteshm0 - open - 23 Jun 2026
avatar hiteshm0 hiteshm0 - change - 23 Jun 2026
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 23 Jun 2026
Category Front End com_banners com_contact com_content com_newsfeeds Libraries
avatar brianteeman
brianteeman - comment - 23 Jun 2026

It's good that you used this in all components that use categories but it's probably not needed in banners as I don't think there is any scenario where that would happen

avatar hiteshm0
hiteshm0 - comment - 24 Jun 2026

@brianteeman should i remove the changes made to the banner component?
although letting it be would make things more consistent with negligible performance overhead.

avatar brianteeman
brianteeman - comment - 24 Jun 2026

Consistency is good. I just wondered if the fix could be made earlier so it doesn't have to be repeated but if not then this is fine.

avatar HLeithner HLeithner - change - 24 Jun 2026
Title
[6.1]Fix: Empty categories displaying due to future-published items
[6.2]Fix: Empty categories displaying due to future-published items
avatar HLeithner HLeithner - edited - 24 Jun 2026
avatar HLeithner
HLeithner - comment - 24 Jun 2026

Thanks for you pr, I rebased this to 6.2 since it might not be expected behaviour I think doing this change in a patch release is an unexpected output change and would like to not do such things in a patch version.

avatar richard67 richard67 - change - 24 Jun 2026
Title
[6.2]Fix: Empty categories displaying due to future-published items
[6.2] Fix: Empty categories displaying due to future-published items
avatar richard67 richard67 - edited - 24 Jun 2026
avatar github-actions[bot]
github-actions[bot] - comment - 24 Jun 2026

This pull request has conflicts, please resolve those before we can evaluate the pull request.

avatar hiteshm0 hiteshm0 - change - 25 Jun 2026
Labels Added: Conflicting Files PR-6.2-dev
avatar hiteshm0 hiteshm0 - change - 25 Jun 2026
Labels Removed: Conflicting Files
avatar drmenzelit
drmenzelit - comment - 17 Jul 2026

This PR solves #47976 only partially. The category with an article to be published in the future doesn't appear in the list of categories (List All Categories in an Article Category Tree), but in the module "Articles - Categories" is still there.
In a category blog it doesn't show either, but the heading "Subcategories" alone looks odd.

avatar gioacchino54 gioacchino54 - test_item - 17 Jul 2026 - Tested unsuccessfully
avatar gioacchino54
gioacchino54 - comment - 17 Jul 2026

I have tested this item 🔴 unsuccessfully on 9de434d

I was unable to reproduce the problem.
The Patch Tester does not contain PRs J6.2


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

avatar gioacchino54
gioacchino54 - comment - 17 Jul 2026

I have tested this item 🔴 unsuccessfully on 9de434d

I was unable to reproduce the problem.
The Patch Tester does not contain PRs J6.2


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

avatar hiteshm0
hiteshm0 - comment - 17 Jul 2026

@drmenzelit

In a category blog it doesn't show either, but the heading "Subcategories" alone looks odd.

and

but in the module "Articles - Categories" is still there.

are both expected behavior if im not wrong ( or rather not caused by a yet to be published article in said category)
( even if said category does not contain any articles , the category is still displayed in those places )

avatar hiteshm0
hiteshm0 - comment - 17 Jul 2026

@drmenzelit

In a category blog it doesn't show either, but the heading "Subcategories" alone looks odd.

and

but in the module "Articles - Categories" is still there.

are both expected behavior if im not wrong ( or rather not caused by a yet to be published article in said category)
( even if said category does not contain any articles , the category is still displayed in those places )

Should we extend the scope of this PR to fix those bugs too?

avatar drmenzelit
drmenzelit - comment - 18 Jul 2026

For me it is not expected behavior, and if we are correcting it for the list of categories, it should be corrected for the list of categories in the module too.

avatar joomla-cms-bot joomla-cms-bot - change - 18 Jul 2026
Category Front End com_banners com_contact com_content com_newsfeeds Libraries Front End com_banners com_contact com_content com_newsfeeds Layout Libraries
avatar hiteshm0 hiteshm0 - change - 18 Jul 2026
The description was changed
avatar hiteshm0 hiteshm0 - edited - 18 Jul 2026
avatar hiteshm0
hiteshm0 - comment - 18 Jul 2026

@drmenzelit
Included the fix to avoid displaying 'Subcategories' when there is no valid subcategory to display in category blog/list modules. Please take a look ( necessary changes have been made to the testing instructions aswell)

Add a Comment

Login with GitHub to post a comment