PR-6.1-dev Pending

User tests: Successful: Unsuccessful:

avatar adarshdubey03
adarshdubey03
24 Feb 2026

…le tags

Pull Request resolves #46751 .

  • 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

Fixes incorrect article counts in the Tags – Popular module when a content item is assigned multiple tags.

The module previously used COUNT(*), which resulted in inflated counts due to row multiplication in the many-to-many join between #__contentitem_tag_map and #__ucm_content.

This change replaces COUNT(*) with:

COUNT(DISTINCT m.core_content_id)

to ensure unique content items are counted per tag.

Testing Instructions

Create two tags (e.g., Tag1 and Tag2).
Create Article 1 and assign both Tag1 and Tag2.
Create Article 2 and assign Tag1.
Create Article 3 and assign Tag1.

Enable the Tags – Popular module with “Display Number of Items” enabled.

Actual result BEFORE applying this Pull Request

Tag1 → 4
Tag2 → 2

Counts are inflated when an article has multiple tags.

Expected result AFTER applying this Pull Request

Tag1 → 3
Tag2 → 1

Each tag correctly reflects the number of unique associated content items.

Additional Notes

core_content_id is defined as NOT NULL, making it safe for DISTINCT aggregation.
No schema changes.
No API changes.
Minimal modification (single-line change).
Verified in normal mode with cache cleared and debug disabled.

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 adarshdubey03 adarshdubey03 - open - 24 Feb 2026
avatar adarshdubey03 adarshdubey03 - change - 24 Feb 2026
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 24 Feb 2026
Category Modules Front End
avatar alikon
alikon - comment - 24 Feb 2026

as the issue are you trying to fix #46751 has been reported from 5.x and marked as bug you should do your pr on branch 5.4

avatar adarshdubey03
adarshdubey03 - comment - 24 Feb 2026

Thank you for the clarification. I will retarget the fix to the 5.4 branch as suggested.

avatar adarshdubey03
adarshdubey03 - comment - 24 Feb 2026

This fix has been retargeted to the 5.4-dev branch as suggested in #47218. Closing this PR to avoid duplicate review.

avatar adarshdubey03 adarshdubey03 - change - 24 Feb 2026
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2026-02-24 17:54:17
Closed_By adarshdubey03
Labels Added: PR-6.1-dev
avatar adarshdubey03 adarshdubey03 - close - 24 Feb 2026

Add a Comment

Login with GitHub to post a comment